Changeset 6843a9c in mainline for boot


Ignore:
Timestamp:
2012-06-29T13:02:14Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
722912e
Parents:
ba72f2b (diff), 0bbd13e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

Trivial conflicts.

Location:
boot
Files:
558 added
1 deleted
24 edited
2 moved

Legend:

Unmodified
Added
Removed
  • boot/Makefile

    rba72f2b r6843a9c  
    4040        $(PACK) $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) arch/$(KARCH) $(COMPONENTS)
    4141
    42 $(INITRD).img: $(INITRD).fs
    43         $(MKHORD) $(PAGE_SIZE) $< $@
    44 
    45 $(INITRD).fs: build_dist
     42$(INITRD).img: build_dist
    4643ifeq ($(RDFMT),tmpfs)
    4744        $(MKTMPFS) $(DIST_PATH) $@
     
    6966                cp "$$file" "$(DIST_PATH)/app/" ; \
    7067        done
    71         for file in $(NET_CFG) ; do \
    72                 cp "$$file" "$(DIST_PATH)/cfg/net/" ; \
    73         done
    7468        for drv in $(RD_DRVS) ; do \
    7569                drv_dir="`dirname "$$drv"`" ; \
     
    9589
    9690clean_dist:
    97         rm -f $(INITRD).fs $(INITRD).img $(COMPS_H) $(COMPS_C) $(LINK) $(LINK).comp *.co
     91        rm -f $(INITRD).img $(COMPS_H) $(COMPS_C) $(LINK) $(LINK).comp *.co
    9892        rm -f $(USPACE_PATH)/dist/srv/*
    9993        rm -rf $(USPACE_PATH)/dist/drv/*
  • boot/Makefile.build

    rba72f2b r6843a9c  
    3434OPTIMIZATION = 3
    3535
    36 DEFS = -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
     36DEFS = -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    3737
    3838GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     
    4646        -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
    4747        -Werror-implicit-function-declaration -wd170
    48 
    49 SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
    50         -xnolib -xc99=all -features=extensions \
    51         -erroff=E_ZERO_SIZED_STRUCT_UNION
    5248
    5349CLANG_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     
    6662        GCC_CFLAGS += -g
    6763        ICC_CFLAGS += -g
    68         SUNCC_CFLAGS += -g
    6964        CLANG_CFLAGS += -g
    7065endif
     
    8378        CFLAGS = $(ICC_CFLAGS) $(EXTRA_CFLAGS)
    8479        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    85 endif
    86 
    87 ifeq ($(COMPILER),suncc)
    88         CFLAGS = $(SUNCC_CFLAGS) $(EXTRA_CFLAGS)
    89         DEFS += $(CONFIG_DEFS)
    90         DEPEND_DEFS = $(DEFS)
    9180endif
    9281
  • boot/Makefile.common

    rba72f2b r6843a9c  
    5353SANDBOX = pack
    5454PACK = $(TOOLS_PATH)/pack.py
    55 MKHORD = $(TOOLS_PATH)/mkhord.py
    5655MKTMPFS = $(TOOLS_PATH)/mktmpfs.py
    5756MKFAT = $(TOOLS_PATH)/mkfat.py
     
    7372        $(USPACE_PATH)/srv/loader/loader \
    7473        $(USPACE_PATH)/app/init/init \
    75         $(USPACE_PATH)/srv/loc/loc \
     74        $(USPACE_PATH)/srv/locsrv/locsrv \
    7675        $(USPACE_PATH)/srv/bd/rd/rd \
    7776        $(USPACE_PATH)/srv/vfs/vfs
     
    9998        $(USPACE_PATH)/srv/bd/part/guid_part/g_part \
    10099        $(USPACE_PATH)/srv/bd/part/mbr_part/mbr_part \
    101         $(USPACE_PATH)/srv/clip/clip \
     100        $(USPACE_PATH)/srv/clipboard/clipboard \
    102101        $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \
    103102        $(USPACE_PATH)/srv/fs/fat/fat \
     
    106105        $(USPACE_PATH)/srv/fs/exfat/exfat \
    107106        $(USPACE_PATH)/srv/fs/ext2fs/ext2fs \
     107        $(USPACE_PATH)/srv/hid/remcons/remcons \
     108        $(USPACE_PATH)/srv/net/ethip/ethip \
     109        $(USPACE_PATH)/srv/net/inetsrv/inetsrv \
     110        $(USPACE_PATH)/srv/net/loopip/loopip \
     111        $(USPACE_PATH)/srv/net/tcp/tcp \
     112        $(USPACE_PATH)/srv/net/udp/udp \
    108113        $(USPACE_PATH)/srv/taskmon/taskmon \
    109         $(USPACE_PATH)/srv/net/nil/eth/eth \
    110         $(USPACE_PATH)/srv/net/nil/nildummy/nildummy \
    111         $(USPACE_PATH)/srv/net/il/arp/arp \
    112         $(USPACE_PATH)/srv/net/il/ip/ip \
    113         $(USPACE_PATH)/srv/net/tl/icmp/icmp \
    114         $(USPACE_PATH)/srv/net/tl/udp/udp \
    115         $(USPACE_PATH)/srv/net/tl/tcp/tcp \
    116         $(USPACE_PATH)/srv/net/net/net \
    117114        $(USPACE_PATH)/srv/devman/devman
    118115
     
    123120        test/test2 \
    124121        test/test3 \
    125         nic/lo \
    126         nic/ne2k
     122        nic/ne2k \
     123        nic/e1k \
     124        nic/rtl8139
    127125
    128126RD_DRV_CFG =
     
    160158        $(USPACE_PATH)/app/edit/edit \
    161159        $(USPACE_PATH)/app/ext2info/ext2info \
     160        $(USPACE_PATH)/app/inet/inet \
    162161        $(USPACE_PATH)/app/kill/kill \
    163162        $(USPACE_PATH)/app/killall/killall \
    164         $(USPACE_PATH)/app/locinfo/locinfo \
     163        $(USPACE_PATH)/app/loc/loc \
    165164        $(USPACE_PATH)/app/mixerctl/mixerctl \
    166165        $(USPACE_PATH)/app/mkfat/mkfat \
     166        $(USPACE_PATH)/app/mkexfat/mkexfat \
    167167        $(USPACE_PATH)/app/mkmfs/mkmfs \
    168168        $(USPACE_PATH)/app/lsusb/lsusb \
     
    177177        $(USPACE_PATH)/app/nettest1/nettest1 \
    178178        $(USPACE_PATH)/app/nettest2/nettest2 \
     179        $(USPACE_PATH)/app/nettest3/nettest3 \
    179180        $(USPACE_PATH)/app/netecho/netecho \
     181        $(USPACE_PATH)/app/nterm/nterm \
    180182        $(USPACE_PATH)/app/ping/ping \
    181183        $(USPACE_PATH)/app/stats/stats \
     
    201203endif
    202204
    203 ifneq ($(CONFIG_BAREBONE),y)
    204 NET_CFG = \
    205         $(USPACE_PATH)/srv/net/cfg/general \
    206         $(USPACE_PATH)/srv/net/cfg/lo.nic \
    207         $(USPACE_PATH)/srv/net/cfg/ne2k.nic
     205ifeq ($(CONFIG_MSIM),y)
     206RD_APPS_NON_ESSENTIAL += \
     207        $(USPACE_PATH)/app/msim/msim
    208208endif
    209209
  • boot/Makefile.grub

    rba72f2b r6843a9c  
    3131include Makefile.common
    3232
    33 STAGE2 = grub/stage2_eltorito
    34 STAGE2_IN = boot/$(STAGE2)
     33GRUB = grub.$(GRUB_ARCH)
     34BOOT = $(DISTROOT)/boot
     35
     36ELTORITO = boot/grub/$(GRUB_ARCH).img
     37IMAGE = $(DISTROOT)/$(ELTORITO)
     38
     39ifeq ($(GRUB_ARCH),pc)
     40        BOOT_CONFIG = $(BOOT)/grub/i386-pc/grub.cfg
     41        MULTIBOOT_CMD = multiboot
     42        MODULE_CMD = module
     43endif
     44ifeq ($(GRUB_ARCH),efi)
     45        BOOT_CONFIG = $(BOOT)/grub/grub.cfg
     46        MULTIBOOT_CMD = multiboot2
     47        MODULE_CMD = module2
     48endif
    3549
    3650all: $(BOOT_OUTPUT)
    3751
    3852$(BOOT_OUTPUT): build_dist
    39         mkisofs -J -r -b $(STAGE2_IN) -no-emul-boot -boot-load-size 4 -boot-info-table -o $@ $(DISTROOT)/
     53ifeq ($(GRUB_ARCH),pc)
     54        $(GENISOIMAGE) -J -r -input-charset utf-8 -V "HelenOS boot ISO" -eltorito-boot $(ELTORITO) -no-emul-boot -boot-load-size 64 -boot-info-table -o $@ $(DISTROOT)/
     55endif
     56ifeq ($(GRUB_ARCH),efi)
     57        $(GENISOIMAGE) -J -r -input-charset utf-8 -V "HelenOS boot ISO" -efi-boot $(ELTORITO) -o $@ $(DISTROOT)/
     58endif
    4059
    4160build_dist: clean
    42         mkdir -p $(DISTROOT)/boot/grub
    43         cp $(STAGE2) $(DISTROOT)/boot/grub/
     61        mkdir -p $(BOOT)
     62        cp -r -L $(GRUB) $(BOOT)/grub
     63ifeq ($(GRUB_ARCH),efi)
     64        gunzip $(IMAGE)
     65endif
     66       
    4467        for module in $(COMPONENTS) ; do \
    45                 cp "$$module" $(DISTROOT)/boot/ ; \
     68                cp "$$module" $(BOOT)/ ; \
    4669        done
    4770       
    48         echo "default 0" > $(DISTROOT)/boot/grub/menu.lst
    49         echo "timeout 10" >> $(DISTROOT)/boot/grub/menu.lst
    50         echo "" >> $(DISTROOT)/boot/grub/menu.lst
    51         echo "title=HelenOS" >> $(DISTROOT)/boot/grub/menu.lst
    52         echo "  root (cd)" >> $(DISTROOT)/boot/grub/menu.lst
     71        echo "set default=0" > $(BOOT_CONFIG)
     72        echo "set timeout=10" >> $(BOOT_CONFIG)
     73        echo "" >> $(BOOT_CONFIG)
     74       
     75ifeq ($(GRUB_ARCH),pc)
     76        echo "insmod vbe" >> $(BOOT_CONFIG)
     77        echo "insmod vga" >> $(BOOT_CONFIG)
     78endif
     79ifeq ($(GRUB_ARCH),efi)
     80        echo "insmod efi_gop" >> $(BOOT_CONFIG)
     81        echo "insmod efi_uga" >> $(BOOT_CONFIG)
     82endif
     83        echo "" >> $(BOOT_CONFIG)
     84       
     85        echo "menuentry 'HelenOS $(RELEASE)' --class helenos --class os {" >> $(BOOT_CONFIG)
    5386        for module in $(MODULES) ; do \
     87                echo "  echo 'Loading $$module'" >> $(BOOT_CONFIG) ; \
    5488                if [ "$$module" = "kernel.bin" ] ; then \
    55                         echo "  kernel /boot/$$module" >> $(DISTROOT)/boot/grub/menu.lst ; \
     89                        echo "  $(MULTIBOOT_CMD) /boot/$$module" >> $(BOOT_CONFIG) ; \
    5690                else \
    57                         echo "  module /boot/$$module" >> $(DISTROOT)/boot/grub/menu.lst ; \
     91                        echo "  $(MODULE_CMD) /boot/$$module /boot/$$module" >> $(BOOT_CONFIG) ; \
    5892                fi \
    5993        done
     94        echo "}" >> $(BOOT_CONFIG)
    6095
    6196clean:
  • boot/Makefile.silo

    rba72f2b r6843a9c  
    4141
    4242$(POST_OUTPUT): build_dist
    43         mkisofs -f -G $(ISOFS_B_IN) -B ... -r -o $@ $(DISTROOT)/
     43        $(GENISOIMAGE) -f -G $(ISOFS_B_IN) -B ... -r -o $@ $(DISTROOT)/
    4444
    4545build_dist: clean
  • boot/Makefile.yaboot

    rba72f2b r6843a9c  
    4040
    4141$(POST_OUTPUT): build_dist
    42         mkisofs -hfs -part -map $(MAPS) -no-desktop -hfs-volid "HelenOS" -hfs-bless $(DISTROOT)/boot -r -o $@ $(DISTROOT)/
     42        $(GENISOIMAGE) -hfs -part -map $(MAPS) -no-desktop -hfs-volid "HelenOS" -hfs-bless $(DISTROOT)/boot -r -o $@ $(DISTROOT)/
    4343
    4444build_dist: clean
  • boot/arch/amd64/Makefile.inc

    rba72f2b r6843a9c  
    2727#
    2828
    29 PAGE_SIZE = 4096
    30 
    3129RD_SRVS_ESSENTIAL += \
    32         $(USPACE_PATH)/srv/hw/char/i8042/i8042 \
    3330        $(USPACE_PATH)/srv/hw/irc/apic/apic \
    3431        $(USPACE_PATH)/srv/hw/irc/i8259/i8259
     
    4340        bus/pci/pciintel \
    4441        bus/isa \
     42        char/i8042 \
     43        char/ns8250 \
     44        char/ps2mouse \
     45        char/xtkbd \
    4546        bus/usb/ehci\
    4647        bus/usb/ohci \
  • boot/arch/arm32/Makefile.inc

    rba72f2b r6843a9c  
    3939BITS = 32
    4040ENDIANESS = LE
    41 PAGE_SIZE = 4096
     41EXTRA_CFLAGS = -march=armv4
    4242
    4343RD_SRVS_ESSENTIAL += \
    44         $(USPACE_PATH)/srv/hid/s3c24xx_ts/s3c24ts \
    45         $(USPACE_PATH)/srv/hw/char/s3c24xx_uart/s3c24ser
     44        $(USPACE_PATH)/srv/hid/s3c24xx_ts/s3c24xx_ts \
     45        $(USPACE_PATH)/srv/hw/char/s3c24xx_uart/s3c24xx_uart
    4646
    4747RD_SRVS_NON_ESSENTIAL += \
     
    5050SOURCES = \
    5151        arch/$(BARCH)/src/asm.S \
     52        arch/$(BARCH)/src/eabi.S \
    5253        arch/$(BARCH)/src/main.c \
    5354        arch/$(BARCH)/src/mm.c \
  • boot/arch/arm32/src/asm.S

    rba72f2b r6843a9c  
    6060        # before passing control to the copied code.
    6161        #
    62         bx r0
     62        mov pc, r0
  • boot/arch/ia64/Makefile.inc

    rba72f2b r6843a9c  
    3333BITS = 64
    3434ENDIANESS = LE
    35 PAGE_SIZE = 16384
    3635EXTRA_CFLAGS = -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -mno-sdata
    3736
    3837RD_SRVS_NON_ESSENTIAL +=
    3938
    40 RD_SRVS_ESSENTIAL += \
    41         $(USPACE_PATH)/srv/hw/char/i8042/i8042
     39RD_SRVS_ESSENTIAL +=
    4240
    4341SOURCES = \
  • boot/arch/ia64/src/main.c

    rba72f2b r6843a9c  
    189189        printf("\nInflating components ... ");
    190190       
     191        /*
     192         * We will use the next available address for a copy of each component to
     193         * make sure that inflate() works with disjunctive memory regions.
     194         */
     195        top = ALIGN_UP(top, PAGE_SIZE);
     196
    191197        for (i = cnt; i > 0; i--) {
    192198                printf("%s ", components[i - 1].name);
    193199               
    194                 int err = inflate(components[i - 1].start, components[i - 1].size,
     200                /*
     201                 * Copy the component to a location which is guaranteed not to
     202                 * overlap with the destination for inflate().
     203                 */
     204                memmove((void *) top, components[i - 1].start, components[i - 1].size);
     205               
     206                int err = inflate((void *) top, components[i - 1].size,
    195207                    dest[i - 1], components[i - 1].inflated);
    196208               
  • boot/arch/ia64/src/pal_asm.S

    rba72f2b r6843a9c  
    3232
    3333pal_static_call:
    34         alloc loc0 = ar.pfs, 7, 5, 0, 0
     34        alloc loc0 = ar.pfs, 7, 6, 0, 0
     35
     36        mov loc1 = psr ;;
     37        mov psr.l = r0 ;;
     38        srlz.i
     39        srlz.d
    3540       
    36         mov loc1 = gp
    37         mov loc2 = rp
     41        mov loc2 = gp
     42        mov loc3 = rp
    3843       
    39         addl loc3 = @gprel(pal_proc), gp
    40        
     44        addl loc4 = @gprel(pal_proc), gp
     45
    4146        mov r28 = in0
    4247        mov r29 = in1
     
    4449        mov r31 = in3 ;;
    4550       
    46         ld8 loc3 = [loc3]
    47         movl loc4 = 0f ;;
     51        ld8 loc4 = [loc4]
     52        movl loc5 = 0f ;;
    4853
    49         mov b6 = loc3
    50         mov rp = loc4 ;;
     54        mov b6 = loc4
     55        mov rp = loc5 ;;
    5156        br.cond.sptk.many b6
    5257
    53580:
     59        mov psr.l = loc1 ;;
     60        srlz.i
     61        srlz.d
     62
    5463        cmp.ne p7,p0 = 0, in4
    5564        cmp.ne p8,p0 = 0, in5
     
    6069(p9)    st8 [in6] = r11
    6170       
    62         mov gp = loc1
    63         mov rp = loc2 ;;
     71        mov gp = loc2
     72        mov rp = loc3 ;;
    6473       
    6574        mov ar.pfs = loc0
  • boot/arch/ia64/src/sal_asm.S

    rba72f2b r6843a9c  
    2929.explicit
    3030
     31#define STACK_SCRATCH_AREA      16
     32#define STACK_IN8               (0 + STACK_SCRATCH_AREA)
     33#define STACK_IN9               (8 + STACK_SCRATCH_AREA)
     34#define STACK_IN10              (16 + STACK_SCRATCH_AREA)
     35
    3136.global sal_call
    3237
     
    3944#
    4045sal_call:
    41         alloc loc0 = ar.pfs, 11, 5, 8, 0
     46        alloc loc0 = ar.pfs, 8, 8, 8, 0
    4247       
     48        adds sp = -STACK_SCRATCH_AREA, sp
     49
    4350        mov loc1 = gp
    4451        mov loc2 = rp
     
    5764       
    5865        ld8 loc3 = [loc3]
    59         ld8 gp = [loc4] ;;
     66        ld8 gp = [loc4]
     67
     68        adds r14 = STACK_IN8 + STACK_SCRATCH_AREA, sp
     69        adds r15 = STACK_IN9 + STACK_SCRATCH_AREA, sp
     70        adds r16 = STACK_IN10 + STACK_SCRATCH_AREA, sp ;;
     71
     72        ld8 loc5 = [r14]
     73        ld8 loc6 = [r15]
     74        ld8 loc7 = [r16]
    6075       
    6176        mov b6 = loc3 ;;
    6277        br.call.sptk.many rp = b6
    6378       
    64         cmp.ne p7,p0 = 0, in8
    65         cmp.ne p8,p0 = 0, in9
    66         cmp.ne p9,p0 = 0, in10 ;;
     79        cmp.ne p7,p0 = 0, loc5
     80        cmp.ne p8,p0 = 0, loc6
     81        cmp.ne p9,p0 = 0, loc7 ;;
    6782       
    68 (p7)    st8 [in8] = r9
    69 (p8)    st8 [in9] = r10
    70 (p9)    st8 [in10] = r11
     83(p7)    st8 [loc5] = r9
     84(p8)    st8 [loc6] = r10
     85(p9)    st8 [loc7] = r11
    7186       
    7287        mov gp = loc1
    73         mov rp = loc2 ;;
     88        mov rp = loc2
     89
     90        adds sp = STACK_SCRATCH_AREA, sp ;;
    7491       
    7592        mov ar.pfs = loc0
    7693        br.ret.sptk.many rp
     94
  • boot/arch/mips32/Makefile.inc

    rba72f2b r6843a9c  
    2929BFD_ARCH = mips
    3030BITS = 32
    31 PAGE_SIZE = 16384
    3231EXTRA_CFLAGS = -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=32
    3332
  • boot/arch/mips64/Makefile.inc

    rba72f2b r6843a9c  
    2929BFD_ARCH = mips:4000
    3030BITS = 64
    31 PAGE_SIZE = 16384
    3231EXTRA_CFLAGS = -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=64
    3332
  • boot/arch/ppc32/Makefile.inc

    rba72f2b r6843a9c  
    3737BITS = 32
    3838ENDIANESS = BE
    39 PAGE_SIZE = 4096
    4039EXTRA_CFLAGS = -mcpu=powerpc -msoft-float -m32
    4140
  • boot/arch/sparc64/Makefile.inc

    rba72f2b r6843a9c  
    3737BITS = 64
    3838ENDIANESS = BE
    39 PAGE_SIZE = 16384
    4039EXTRA_CFLAGS = -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow
    4140
  • boot/genarch/include/division.h

    rba72f2b r6843a9c  
    3333#define BOOT_DIVISION_H_
    3434
    35 /* 32bit integer division */
    3635extern int __divsi3(int, int);
    37 
    38 /* 64bit integer division */
    3936extern long long __divdi3(long long, long long);
    4037
    41 /* 32bit unsigned integer division */
    4238extern unsigned int __udivsi3(unsigned int, unsigned int);
    43 
    44 /* 64bit unsigned integer division */
    4539extern unsigned long long __udivdi3(unsigned long long, unsigned long long);
    4640
    47 /* 32bit remainder of the signed division */
    4841extern int __modsi3(int, int);
    49 
    50 /* 64bit remainder of the signed division */
    5142extern long long __moddi3(long long, long long);
    5243
    53 /* 32bit remainder of the unsigned division */
    5444extern unsigned int __umodsi3(unsigned int, unsigned int);
    55 
    56 /* 64bit remainder of the unsigned division */
    5745extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
    5846
     47extern int __divmodsi3(int, int, int *);
     48extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
     49
     50extern long long __divmoddi3(long long, long long, long long *);
    5951extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
    6052    unsigned long long *);
  • boot/genarch/src/division.c

    rba72f2b r6843a9c  
    7373{
    7474        unsigned long long result;
    75         int steps = sizeof(unsigned long long) * 8; 
     75        int steps = sizeof(unsigned long long) * 8;
    7676       
    7777        *remainder = 0;
     
    104104
    105105/* 32bit integer division */
    106 int __divsi3(int a, int b) 
     106int __divsi3(int a, int b)
    107107{
    108108        unsigned int rem;
     
    116116
    117117/* 64bit integer division */
    118 long long __divdi3(long long a, long long b) 
     118long long __divdi3(long long a, long long b)
    119119{
    120120        unsigned long long rem;
     
    155155
    156156/* 64bit remainder of the signed division */
    157 long long __moddi3(long long a,long long b)
     157long long __moddi3(long long a, long long b)
    158158{
    159159        unsigned long long rem;
     
    183183}
    184184
     185int __divmodsi3(int a, int b, int *c)
     186{
     187        unsigned int rem;
     188        int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
     189       
     190        if (SGN(a) == SGN(b)) {
     191                *c = rem;
     192                return result;
     193        }
     194       
     195        *c = -rem;
     196        return -result;
     197}
     198
     199unsigned int __udivmodsi3(unsigned int a, unsigned int b,
     200    unsigned int *c)
     201{
     202        return divandmod32(a, b, c);
     203}
     204
     205long long __divmoddi3(long long a, long long b, long long *c)
     206{
     207        unsigned long long rem;
     208        long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
     209       
     210        if (SGN(a) == SGN(b)) {
     211                *c = rem;
     212                return result;
     213        }
     214       
     215        *c = -rem;
     216        return -result;
     217}
     218
    185219unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
    186220    unsigned long long *c)
  • boot/generic/include/memstr.h

    rba72f2b r6843a9c  
    3636
    3737extern void *memcpy(void *, const void *, size_t);
     38extern void *memmove(void *, const void *, size_t);
    3839
    3940#endif
  • boot/generic/src/memstr.c

    rba72f2b r6843a9c  
    5151}
    5252
     53/** Move memory block with possible overlapping.
     54 *
     55 * Copy cnt bytes from src address to dst address. The source
     56 * and destination memory areas may overlap.
     57 *
     58 * @param dst Destination address to copy to.
     59 * @param src Source address to copy from.
     60 * @param cnt Number of bytes to copy.
     61 *
     62 * @return Destination address.
     63 *
     64 */
     65void *memmove(void *dst, const void *src, size_t cnt)
     66{
     67        /* Nothing to do? */
     68        if (src == dst)
     69                return dst;
     70       
     71        /* Non-overlapping? */
     72        if ((dst >= src + cnt) || (src >= dst + cnt))
     73                return memcpy(dst, src, cnt);
     74       
     75        uint8_t *dp;
     76        const uint8_t *sp;
     77       
     78        /* Which direction? */
     79        if (src > dst) {
     80                /* Forwards. */
     81                dp = dst;
     82                sp = src;
     83               
     84                while (cnt-- != 0)
     85                        *dp++ = *sp++;
     86        } else {
     87                /* Backwards. */
     88                dp = dst + (cnt - 1);
     89                sp = src + (cnt - 1);
     90               
     91                while (cnt-- != 0)
     92                        *dp-- = *sp--;
     93        }
     94       
     95        return dst;
     96}
     97
    5398/** @}
    5499 */
  • boot/generic/src/printf_core.c

    rba72f2b r6843a9c  
    210210        /* Print leading spaces. */
    211211        size_t strw = str_length(str);
    212         if (precision == 0)
     212        if ((precision == 0) || (precision > strw))
    213213                precision = strw;
    214214       
  • boot/generic/src/str.c

    rba72f2b r6843a9c  
    100100#include <str.h>
    101101#include <errno.h>
     102
     103/** Check the condition if wchar_t is signed */
     104#ifdef WCHAR_IS_UNSIGNED
     105        #define WCHAR_SIGNED_CHECK(cond)  (true)
     106#else
     107        #define WCHAR_SIGNED_CHECK(cond)  (cond)
     108#endif
    102109
    103110/** Byte mask consisting of lowest @n bits (out of 8) */
     
    198205 *         code was invalid.
    199206 */
    200 int chr_encode(wchar_t ch, char *str, size_t *offset, size_t size)
     207int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size)
    201208{
    202209        if (*offset >= size)
     
    325332bool ascii_check(wchar_t ch)
    326333{
    327         if ((ch >= 0) && (ch <= 127))
     334        if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
    328335                return true;
    329336       
     
    338345bool chr_check(wchar_t ch)
    339346{
    340         if ((ch >= 0) && (ch <= 1114111))
     347        if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
    341348                return true;
    342349       
  • boot/generic/src/version.c

    rba72f2b r6843a9c  
    3232
    3333static const char *project = "HelenOS bootloader";
    34 static const char *copyright = "Copyright (c) 2001-2011 HelenOS project";
     34static const char *copyright = STRING(COPYRIGHT);
    3535static const char *release = STRING(RELEASE);
    3636static const char *name = STRING(NAME);
  • boot/grub.pc/README

    rba72f2b r6843a9c  
     1The binary files of GRUB boot loader in this directory have been created
     2by compiling GRUB for the 'i386-pc' target and then using the grub-mkrescue
     3script to create the El Torito boot image.
     4
    15For licensing terms of GRUB boot loader see the file COPYING contained
    26in this directory. Full version of GRUB, including its source code,
Note: See TracChangeset for help on using the changeset viewer.