Changeset 85f2064 in mainline for boot


Ignore:
Timestamp:
2012-04-12T14:21:46Z (14 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bb8f69d
Parents:
751cabc (diff), d11a181 (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

Location:
boot
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.build

    r751cabc r85f2064  
    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) \
  • boot/arch/arm32/Makefile.inc

    r751cabc r85f2064  
    3939BITS = 32
    4040ENDIANESS = LE
     41EXTRA_CFLAGS = -march=armv4
    4142
    4243RD_SRVS_ESSENTIAL += \
     
    4950SOURCES = \
    5051        arch/$(BARCH)/src/asm.S \
     52        arch/$(BARCH)/src/eabi.S \
    5153        arch/$(BARCH)/src/main.c \
    5254        arch/$(BARCH)/src/mm.c \
  • boot/arch/arm32/src/asm.S

    r751cabc r85f2064  
    6060        # before passing control to the copied code.
    6161        #
    62         bx r0
     62        mov pc, r0
  • boot/arch/ia64/src/main.c

    r751cabc r85f2064  
    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/genarch/include/division.h

    r751cabc r85f2064  
    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

    r751cabc r85f2064  
    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

    r751cabc r85f2064  
    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

    r751cabc r85f2064  
    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/str.c

    r751cabc r85f2064  
    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

    r751cabc r85f2064  
    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);
Note: See TracChangeset for help on using the changeset viewer.