Changeset ac47b7c2 in mainline for kernel


Ignore:
Timestamp:
2009-06-18T08:30:50Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12956e57
Parents:
553492be
Message:

define endianess externally to be able to exactly specify whether we are using UTF-32LE or UTF-32BE
quit messing with BOM in UTF-32

Location:
kernel
Files:
7 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r553492be rac47b7c2  
    4545#
    4646
    47 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)"
     47DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    4848
    4949GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    50         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8 \
    51         -fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \
    52         -nostdlib -nostdinc -pipe
     50        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
     51        -finput-charset=UTF-8 -fno-builtin -Wall -Wextra -Wno-unused-parameter \
     52        -Wmissing-prototypes -Werror -nostdlib -nostdinc -pipe
    5353
    5454ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
  • kernel/arch/amd64/Makefile.inc

    r553492be rac47b7c2  
    4242SUNCC_CFLAGS += -m64 -xmodel=kernel
    4343
    44 DEFS += -D__64_BITS__
     44BITS = 64
     45ENDIANESS = LE
    4546
    4647## Accepted CPUs
  • kernel/arch/arm32/Makefile.inc

    r553492be rac47b7c2  
    4040GCC_CFLAGS += -fno-zero-initialized-in-bss
    4141
    42 DEFS += -D__32_BITS__
     42BITS = 32
     43ENDIANESS = LE
    4344
    4445ARCH_SOURCES = \
  • kernel/arch/ia32/Makefile.inc

    r553492be rac47b7c2  
    3636TOOLCHAIN_DIR = $(CROSS_PREFIX)/i686
    3737
    38 DEFS += -D__32_BITS__
     38BITS = 32
     39ENDIANESS = LE
    3940
    4041CMN1 = -m32
  • kernel/arch/ia64/Makefile.inc

    r553492be rac47b7c2  
    4242AFLAGS += -mconstant-gp
    4343
    44 DEFS += -D__64_BITS__
     44BITS = 64
     45ENDIANESS = LE
    4546
    4647ARCH_SOURCES = \
  • kernel/arch/mips32/Makefile.inc

    r553492be rac47b7c2  
    3737GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3
    3838
    39 DEFS += -D__32_BITS__
     39BITS = 32
    4040
    4141## Accepted MACHINEs
     
    4444ifeq ($(MACHINE),lgxemul)
    4545        BFD_NAME = elf32-tradlittlemips
     46        ENDIANESS = LE
    4647endif
    4748ifeq ($(MACHINE),bgxemul)
     
    4950        TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips
    5051        TARGET = mips-linux-gnu
    51         GCC_CFLAGS += -DBIG_ENDIAN
     52        ENDIANESS = BE
     53        GCC_CFLAGS += -D__BE__
    5254endif
    5355ifeq ($(MACHINE),msim)
    5456        BFD_NAME = elf32-tradlittlemips
     57        ENDIANESS = LE
    5558        GCC_CFLAGS += -mhard-float
    5659endif
  • kernel/arch/mips32/include/elf.h

    r553492be rac47b7c2  
    2727 */
    2828
    29 /** @addtogroup mips32 
     29/** @addtogroup mips32
    3030 * @{
    3131 */
     
    3636#define KERN_mips32_ELF_H_
    3737
    38 #include <byteorder.h>
     38#define ELF_MACHINE  EM_MIPS
    3939
    40 #define ELF_MACHINE             EM_MIPS
    41 
    42 #ifdef ARCH_IS_BIG_ENDIAN
    43 #  define ELF_DATA_ENCODING     ELFDATA2MSB
     40#ifdef __BE__
     41        #define ELF_DATA_ENCODING  ELFDATA2MSB
    4442#else
    45 #  define ELF_DATA_ENCODING     ELFDATA2LSB
     43        #define ELF_DATA_ENCODING  ELFDATA2LSB
    4644#endif
    4745
    48 #define ELF_CLASS               ELFCLASS32
     46#define ELF_CLASS  ELFCLASS32
    4947
    5048#endif
  • kernel/arch/ppc32/Makefile.inc

    r553492be rac47b7c2  
    4040LFLAGS += -no-check-sections -N
    4141
    42 DEFS += -D__32_BITS__
     42BITS = 32
     43ENDIANESS = BE
    4344
    4445ARCH_SOURCES = \
  • kernel/arch/sparc64/Makefile.inc

    r553492be rac47b7c2  
    4141LFLAGS += -no-check-sections -N
    4242
    43 DEFS += -D__64_BITS__
     43BITS = 64
     44ENDIANESS = BE
    4445
    4546ifeq ($(PROCESSOR),us)
  • kernel/generic/include/byteorder.h

    r553492be rac47b7c2  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_BYTEORDER_H_
    3737
    38 #include <arch/byteorder.h>
    3938#include <arch/types.h>
    4039
    41 #if !(defined(ARCH_IS_BIG_ENDIAN) ^ defined(ARCH_IS_LITTLE_ENDIAN))
    42 #error The architecture must be either big-endian or little-endian.
     40#if !(defined(__BE__) ^ defined(__LE__))
     41        #error The architecture must be either big-endian or little-endian.
    4342#endif
    4443
    45 #ifdef ARCH_IS_BIG_ENDIAN
     44#ifdef __BE__
    4645
    47 #define uint16_t_le2host(n)             uint16_t_byteorder_swap(n)
    48 #define uint32_t_le2host(n)             uint32_t_byteorder_swap(n)
    49 #define uint64_t_le2host(n)             uint64_t_byteorder_swap(n)
     46#define uint16_t_le2host(n)  (uint16_t_byteorder_swap(n))
     47#define uint32_t_le2host(n)  (uint32_t_byteorder_swap(n))
     48#define uint64_t_le2host(n)  (uint64_t_byteorder_swap(n))
    5049
    51 #define uint16_t_be2host(n)             (n)
    52 #define uint32_t_be2host(n)             (n)
    53 #define uint64_t_be2host(n)             (n)
     50#define uint16_t_be2host(n)  (n)
     51#define uint32_t_be2host(n)  (n)
     52#define uint64_t_be2host(n)  (n)
    5453
    55 #define host2uint16_t_le(n)             uint16_t_byteorder_swap(n)
    56 #define host2uint32_t_le(n)             uint32_t_byteorder_swap(n)
    57 #define host2uint64_t_le(n)             uint64_t_byteorder_swap(n)
     54#define host2uint16_t_le(n)  (uint16_t_byteorder_swap(n))
     55#define host2uint32_t_le(n)  (uint32_t_byteorder_swap(n))
     56#define host2uint64_t_le(n)  (uint64_t_byteorder_swap(n))
    5857
    59 #define host2uint16_t_be(n)             (n)
    60 #define host2uint32_t_be(n)             (n)
    61 #define host2uint64_t_be(n)             (n)
     58#define host2uint16_t_be(n)  (n)
     59#define host2uint32_t_be(n)  (n)
     60#define host2uint64_t_be(n)  (n)
    6261
    6362#else
    6463
    65 #define uint16_t_le2host(n)             (n)
    66 #define uint32_t_le2host(n)             (n)
    67 #define uint64_t_le2host(n)             (n)
     64#define uint16_t_le2host(n)  (n)
     65#define uint32_t_le2host(n)  (n)
     66#define uint64_t_le2host(n)  (n)
    6867
    69 #define uint16_t_be2host(n)             uint16_t_byteorder_swap(n)
    70 #define uint32_t_be2host(n)             uint32_t_byteorder_swap(n)
    71 #define uint64_t_be2host(n)             uint64_t_byteorder_swap(n)
     68#define uint16_t_be2host(n)  (uint16_t_byteorder_swap(n))
     69#define uint32_t_be2host(n)  (uint32_t_byteorder_swap(n))
     70#define uint64_t_be2host(n)  (uint64_t_byteorder_swap(n))
    7271
    73 #define host2uint16_t_le(n)             (n)
    74 #define host2uint32_t_le(n)             (n)
    75 #define host2uint64_t_le(n)             (n)
     72#define host2uint16_t_le(n)  (n)
     73#define host2uint32_t_le(n)  (n)
     74#define host2uint64_t_le(n)  (n)
    7675
    77 #define host2uint16_t_be(n)             uint16_t_byteorder_swap(n)
    78 #define host2uint32_t_be(n)             uint32_t_byteorder_swap(n)
    79 #define host2uint64_t_be(n)             uint64_t_byteorder_swap(n)
     76#define host2uint16_t_be(n)  (uint16_t_byteorder_swap(n))
     77#define host2uint32_t_be(n)  (uint32_t_byteorder_swap(n))
     78#define host2uint64_t_be(n)  (uint64_t_byteorder_swap(n))
    8079
    8180#endif
  • kernel/generic/include/string.h

    r553492be rac47b7c2  
    5858#define U_CURSOR       0x2588
    5959
    60 #define U_BOM          0xfeff
    61 
    6260/**< No size limit constant */
    6361#define STR_NO_LIMIT  ((size_t) -1)
  • kernel/generic/src/printf/printf_core.c

    r553492be rac47b7c2  
    302302        if (str == NULL)
    303303                return printf_putstr(nullstr, ps);
    304        
    305         if (*str == U_BOM)
    306                 str++;
    307304       
    308305        /* Print leading spaces. */
Note: See TracChangeset for help on using the changeset viewer.