Changeset c127e1c in mainline for boot


Ignore:
Timestamp:
2012-04-11T15:37:01Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49a736e2
Parents:
3a01483 (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:

Mainline changes.

Location:
boot
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/Makefile.inc

    r3a01483 rc127e1c  
    4949BITS = 32
    5050ENDIANESS = LE
     51EXTRA_CFLAGS = -march=armv4
    5152
    5253ifeq ($(MACHINE), gta02)
     
    7374SOURCES = \
    7475        arch/$(BARCH)/src/asm.S \
     76        arch/$(BARCH)/src/eabi.S \
    7577        arch/$(BARCH)/src/main.c \
    7678        arch/$(BARCH)/src/mm.c \
  • boot/arch/arm32/src/asm.S

    r3a01483 rc127e1c  
    6060        # before passing control to the copied code.
    6161        #
    62         bx r0
     62        mov pc, r0
  • boot/genarch/include/division.h

    r3a01483 rc127e1c  
    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

    r3a01483 rc127e1c  
    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/src/str.c

    r3a01483 rc127e1c  
    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       
Note: See TracChangeset for help on using the changeset viewer.