/trunk/kernel/generic/include/byteorder.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup generic |
/** @addtogroup generic |
* @{ |
*/ |
/** @file |
35,48 → 35,47 |
#ifndef KERN_BYTEORDER_H_ |
#define KERN_BYTEORDER_H_ |
#include <arch/byteorder.h> |
#include <arch/types.h> |
#if !(defined(ARCH_IS_BIG_ENDIAN) ^ defined(ARCH_IS_LITTLE_ENDIAN)) |
#error The architecture must be either big-endian or little-endian. |
#if !(defined(__BE__) ^ defined(__LE__)) |
#error The architecture must be either big-endian or little-endian. |
#endif |
#ifdef ARCH_IS_BIG_ENDIAN |
#ifdef __BE__ |
#define uint16_t_le2host(n) uint16_t_byteorder_swap(n) |
#define uint32_t_le2host(n) uint32_t_byteorder_swap(n) |
#define uint64_t_le2host(n) uint64_t_byteorder_swap(n) |
#define uint16_t_le2host(n) (uint16_t_byteorder_swap(n)) |
#define uint32_t_le2host(n) (uint32_t_byteorder_swap(n)) |
#define uint64_t_le2host(n) (uint64_t_byteorder_swap(n)) |
#define uint16_t_be2host(n) (n) |
#define uint32_t_be2host(n) (n) |
#define uint64_t_be2host(n) (n) |
#define uint16_t_be2host(n) (n) |
#define uint32_t_be2host(n) (n) |
#define uint64_t_be2host(n) (n) |
#define host2uint16_t_le(n) uint16_t_byteorder_swap(n) |
#define host2uint32_t_le(n) uint32_t_byteorder_swap(n) |
#define host2uint64_t_le(n) uint64_t_byteorder_swap(n) |
#define host2uint16_t_le(n) (uint16_t_byteorder_swap(n)) |
#define host2uint32_t_le(n) (uint32_t_byteorder_swap(n)) |
#define host2uint64_t_le(n) (uint64_t_byteorder_swap(n)) |
#define host2uint16_t_be(n) (n) |
#define host2uint32_t_be(n) (n) |
#define host2uint64_t_be(n) (n) |
#define host2uint16_t_be(n) (n) |
#define host2uint32_t_be(n) (n) |
#define host2uint64_t_be(n) (n) |
#else |
#define uint16_t_le2host(n) (n) |
#define uint32_t_le2host(n) (n) |
#define uint64_t_le2host(n) (n) |
#define uint16_t_le2host(n) (n) |
#define uint32_t_le2host(n) (n) |
#define uint64_t_le2host(n) (n) |
#define uint16_t_be2host(n) uint16_t_byteorder_swap(n) |
#define uint32_t_be2host(n) uint32_t_byteorder_swap(n) |
#define uint64_t_be2host(n) uint64_t_byteorder_swap(n) |
#define uint16_t_be2host(n) (uint16_t_byteorder_swap(n)) |
#define uint32_t_be2host(n) (uint32_t_byteorder_swap(n)) |
#define uint64_t_be2host(n) (uint64_t_byteorder_swap(n)) |
#define host2uint16_t_le(n) (n) |
#define host2uint32_t_le(n) (n) |
#define host2uint64_t_le(n) (n) |
#define host2uint16_t_le(n) (n) |
#define host2uint32_t_le(n) (n) |
#define host2uint64_t_le(n) (n) |
#define host2uint16_t_be(n) uint16_t_byteorder_swap(n) |
#define host2uint32_t_be(n) uint32_t_byteorder_swap(n) |
#define host2uint64_t_be(n) uint64_t_byteorder_swap(n) |
#define host2uint16_t_be(n) (uint16_t_byteorder_swap(n)) |
#define host2uint32_t_be(n) (uint32_t_byteorder_swap(n)) |
#define host2uint64_t_be(n) (uint64_t_byteorder_swap(n)) |
#endif |
/trunk/kernel/generic/include/string.h |
---|
57,8 → 57,6 |
#define U_CURSOR 0x2588 |
#define U_BOM 0xfeff |
/**< No size limit constant */ |
#define STR_NO_LIMIT ((size_t) -1) |
/trunk/kernel/generic/src/printf/printf_core.c |
---|
302,9 → 302,6 |
if (str == NULL) |
return printf_putstr(nullstr, ps); |
if (*str == U_BOM) |
str++; |
/* Print leading spaces. */ |
size_t strw = wstr_length(str); |
if (precision == 0) |
/trunk/kernel/Makefile |
---|
44,12 → 44,12 |
## Common compiler flags |
# |
DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" |
DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ |
GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \ |
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8 \ |
-fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \ |
-nostdlib -nostdinc -pipe |
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \ |
-finput-charset=UTF-8 -fno-builtin -Wall -Wextra -Wno-unused-parameter \ |
-Wmissing-prototypes -Werror -nostdlib -nostdinc -pipe |
ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \ |
-fno-builtin -Wall -Wmissing-prototypes -Werror \ |
/trunk/kernel/arch/sparc64/include/byteorder.h |
---|
File deleted |
/trunk/kernel/arch/sparc64/Makefile.inc |
---|
40,7 → 40,8 |
LFLAGS += -no-check-sections -N |
DEFS += -D__64_BITS__ |
BITS = 64 |
ENDIANESS = BE |
ifeq ($(PROCESSOR),us) |
DEFS += -DUS |
/trunk/kernel/arch/ia64/include/byteorder.h |
---|
File deleted |
/trunk/kernel/arch/ia64/Makefile.inc |
---|
41,7 → 41,8 |
LFLAGS += -EL |
AFLAGS += -mconstant-gp |
DEFS += -D__64_BITS__ |
BITS = 64 |
ENDIANESS = LE |
ARCH_SOURCES = \ |
arch/$(KARCH)/src/start.S \ |
/trunk/kernel/arch/arm32/include/byteorder.h |
---|
File deleted |
/trunk/kernel/arch/arm32/Makefile.inc |
---|
39,7 → 39,8 |
GCC_CFLAGS += -fno-zero-initialized-in-bss |
DEFS += -D__32_BITS__ |
BITS = 32 |
ENDIANESS = LE |
ARCH_SOURCES = \ |
arch/$(KARCH)/src/start.S \ |
/trunk/kernel/arch/ppc32/include/byteorder.h |
---|
File deleted |
/trunk/kernel/arch/ppc32/Makefile.inc |
---|
39,7 → 39,8 |
AFLAGS += -a32 |
LFLAGS += -no-check-sections -N |
DEFS += -D__32_BITS__ |
BITS = 32 |
ENDIANESS = BE |
ARCH_SOURCES = \ |
arch/$(KARCH)/src/context.S \ |
/trunk/kernel/arch/amd64/include/byteorder.h |
---|
File deleted |
/trunk/kernel/arch/amd64/Makefile.inc |
---|
41,7 → 41,8 |
ICC_CFLAGS += $(CMN1) |
SUNCC_CFLAGS += -m64 -xmodel=kernel |
DEFS += -D__64_BITS__ |
BITS = 64 |
ENDIANESS = LE |
## Accepted CPUs |
# |
/trunk/kernel/arch/mips32/include/byteorder.h |
---|
File deleted |
/trunk/kernel/arch/mips32/include/elf.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup mips32 |
/** @addtogroup mips32 |
* @{ |
*/ |
/** @file |
35,17 → 35,15 |
#ifndef KERN_mips32_ELF_H_ |
#define KERN_mips32_ELF_H_ |
#include <byteorder.h> |
#define ELF_MACHINE EM_MIPS |
#define ELF_MACHINE EM_MIPS |
#ifdef ARCH_IS_BIG_ENDIAN |
# define ELF_DATA_ENCODING ELFDATA2MSB |
#ifdef __BE__ |
#define ELF_DATA_ENCODING ELFDATA2MSB |
#else |
# define ELF_DATA_ENCODING ELFDATA2LSB |
#define ELF_DATA_ENCODING ELFDATA2LSB |
#endif |
#define ELF_CLASS ELFCLASS32 |
#define ELF_CLASS ELFCLASS32 |
#endif |
/trunk/kernel/arch/mips32/Makefile.inc |
---|
36,7 → 36,7 |
GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 |
DEFS += -D__32_BITS__ |
BITS = 32 |
## Accepted MACHINEs |
# |
43,15 → 43,18 |
ifeq ($(MACHINE),lgxemul) |
BFD_NAME = elf32-tradlittlemips |
ENDIANESS = LE |
endif |
ifeq ($(MACHINE),bgxemul) |
BFD_NAME = elf32-tradbigmips |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips |
TARGET = mips-linux-gnu |
GCC_CFLAGS += -DBIG_ENDIAN |
ENDIANESS = BE |
GCC_CFLAGS += -D__BE__ |
endif |
ifeq ($(MACHINE),msim) |
BFD_NAME = elf32-tradlittlemips |
ENDIANESS = LE |
GCC_CFLAGS += -mhard-float |
endif |
/trunk/kernel/arch/ia32/include/byteorder.h |
---|
File deleted |
/trunk/kernel/arch/ia32/Makefile.inc |
---|
35,7 → 35,8 |
TARGET = i686-pc-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/i686 |
DEFS += -D__32_BITS__ |
BITS = 32 |
ENDIANESS = LE |
CMN1 = -m32 |
GCC_CFLAGS += $(CMN1) |
/trunk/uspace/lib/softfloat/include/sftypes.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup softfloat |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
41,40 → 41,40 |
typedef union { |
float f; |
uint32_t binary; |
struct { |
#if defined(ARCH_IS_BIG_ENDIAN) |
uint32_t sign:1; |
uint32_t exp:8; |
uint32_t fraction:23; |
#elif defined(ARCH_IS_LITTLE_ENDIAN) |
uint32_t fraction:23; |
uint32_t exp:8; |
uint32_t sign:1; |
#else |
#error "Unknown endians." |
struct { |
#if defined(__BE__) |
uint32_t sign : 1; |
uint32_t exp : 8; |
uint32_t fraction : 23; |
#elif defined(__LE__) |
uint32_t fraction : 23; |
uint32_t exp : 8; |
uint32_t sign : 1; |
#else |
#error Unknown endianess |
#endif |
} parts __attribute__ ((packed)); |
} float32; |
} float32; |
typedef union { |
double d; |
uint64_t binary; |
struct { |
#if defined(ARCH_IS_BIG_ENDIAN) |
uint64_t sign:1; |
uint64_t exp:11; |
uint64_t fraction:52; |
#elif defined(ARCH_IS_LITTLE_ENDIAN) |
uint64_t fraction:52; |
uint64_t exp:11; |
uint64_t sign:1; |
#else |
#error "Unknown endians." |
struct { |
#if defined(__BE__) |
uint64_t sign : 1; |
uint64_t exp : 11; |
uint64_t fraction : 52; |
#elif defined(__LE__) |
uint64_t fraction : 52; |
uint64_t exp : 11; |
uint64_t sign : 1; |
#else |
#error Unknown endianess |
#endif |
} parts __attribute__ ((packed)); |
} float64; |
} parts __attribute__ ((packed)); |
} float64; |
#define FLOAT32_MAX 0x7f800000 |
#define FLOAT32_MIN 0xff800000 |
109,7 → 109,5 |
#endif |
/** @} |
/** @} |
*/ |
/trunk/uspace/lib/softfloat/Makefile |
---|
36,7 → 36,7 |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS +=-Iinclude -Iarch/$(UARCH)/include/ |
CFLAGS += -Iinclude -Iarch/$(UARCH)/include/ |
## Sources |
# |
/trunk/uspace/lib/libc/include/byteorder.h |
---|
35,48 → 35,47 |
#ifndef LIBC_BYTEORDER_H_ |
#define LIBC_BYTEORDER_H_ |
#include <libarch/byteorder.h> |
#include <stdint.h> |
#if !(defined(ARCH_IS_BIG_ENDIAN) ^ defined(ARCH_IS_LITTLE_ENDIAN)) |
#error The architecture must be either big-endian or little-endian. |
#if !(defined(__BE__) ^ defined(__LE__)) |
#error The architecture must be either big-endian or little-endian. |
#endif |
#ifdef ARCH_IS_BIG_ENDIAN |
#ifdef __BE__ |
#define uint16_t_le2host(n) uint16_t_byteorder_swap(n) |
#define uint32_t_le2host(n) uint32_t_byteorder_swap(n) |
#define uint64_t_le2host(n) uint64_t_byteorder_swap(n) |
#define uint16_t_le2host(n) (uint16_t_byteorder_swap(n)) |
#define uint32_t_le2host(n) (uint32_t_byteorder_swap(n)) |
#define uint64_t_le2host(n) (uint64_t_byteorder_swap(n)) |
#define uint16_t_be2host(n) (n) |
#define uint32_t_be2host(n) (n) |
#define uint64_t_be2host(n) (n) |
#define uint16_t_be2host(n) (n) |
#define uint32_t_be2host(n) (n) |
#define uint64_t_be2host(n) (n) |
#define host2uint16_t_le(n) uint16_t_byteorder_swap(n) |
#define host2uint32_t_le(n) uint32_t_byteorder_swap(n) |
#define host2uint64_t_le(n) uint64_t_byteorder_swap(n) |
#define host2uint16_t_le(n) (uint16_t_byteorder_swap(n)) |
#define host2uint32_t_le(n) (uint32_t_byteorder_swap(n)) |
#define host2uint64_t_le(n) (uint64_t_byteorder_swap(n)) |
#define host2uint16_t_be(n) (n) |
#define host2uint32_t_be(n) (n) |
#define host2uint64_t_be(n) (n) |
#define host2uint16_t_be(n) (n) |
#define host2uint32_t_be(n) (n) |
#define host2uint64_t_be(n) (n) |
#else |
#define uint16_t_le2host(n) (n) |
#define uint32_t_le2host(n) (n) |
#define uint64_t_le2host(n) (n) |
#define uint16_t_le2host(n) (n) |
#define uint32_t_le2host(n) (n) |
#define uint64_t_le2host(n) (n) |
#define uint16_t_be2host(n) uint16_t_byteorder_swap(n) |
#define uint32_t_be2host(n) uint32_t_byteorder_swap(n) |
#define uint64_t_be2host(n) uint64_t_byteorder_swap(n) |
#define uint16_t_be2host(n) (uint16_t_byteorder_swap(n)) |
#define uint32_t_be2host(n) (uint32_t_byteorder_swap(n)) |
#define uint64_t_be2host(n) (uint64_t_byteorder_swap(n)) |
#define host2uint16_t_le(n) (n) |
#define host2uint32_t_le(n) (n) |
#define host2uint64_t_le(n) (n) |
#define host2uint16_t_le(n) (n) |
#define host2uint32_t_le(n) (n) |
#define host2uint64_t_le(n) (n) |
#define host2uint16_t_be(n) uint16_t_byteorder_swap(n) |
#define host2uint32_t_be(n) uint32_t_byteorder_swap(n) |
#define host2uint64_t_be(n) uint64_t_byteorder_swap(n) |
#define host2uint16_t_be(n) (uint16_t_byteorder_swap(n)) |
#define host2uint32_t_be(n) (uint32_t_byteorder_swap(n)) |
#define host2uint64_t_be(n) (uint64_t_byteorder_swap(n)) |
#endif |
/trunk/uspace/lib/libc/include/string.h |
---|
40,7 → 40,6 |
#include <bool.h> |
#define U_SPECIAL '?' |
#define U_BOM 0xfeff |
/** No size limit constant */ |
#define STR_NO_LIMIT ((size_t) -1) |
/trunk/uspace/lib/libc/Makefile.toolchain |
---|
27,9 → 27,10 |
# |
CFLAGS = -I$(LIBC_PREFIX)/include -O3 -imacros $(LIBC_PREFIX)/../../../config.h \ |
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8 \ |
-fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \ |
-Werror-implicit-function-declaration -nostdlib -nostdinc -pipe -g |
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \ |
-finput-charset=UTF-8 -fno-builtin -Wall -Wextra -Wno-unused-parameter \ |
-Wmissing-prototypes -Werror-implicit-function-declaration -nostdlib \ |
-nostdinc -pipe -g -D__$(ENDIANESS)__ |
LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a |
AFLAGS = |
/trunk/uspace/lib/libc/generic/io/printf_core.c |
---|
301,9 → 301,6 |
if (str == NULL) |
return printf_putstr(nullstr, ps); |
if (*str == U_BOM) |
str++; |
/* Print leading spaces. */ |
size_t strw = wstr_length(str); |
if (precision == 0) |
/trunk/uspace/lib/libc/Makefile |
---|
32,6 → 32,7 |
LIBC_PREFIX = $(shell pwd) |
SOFTINT_PREFIX = ../softint |
## Setup toolchain |
# |
/trunk/uspace/lib/libc/arch/sparc64/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/sparc64/Makefile.inc |
---|
38,5 → 38,7 |
CFLAGS += -mcpu=ultrasparc -m64 |
LFLAGS += -no-check-sections -N |
ENDIANESS = BE |
BFD_NAME = elf64-sparc |
BFD_ARCH = sparc |
/trunk/uspace/lib/libc/arch/ia64/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/ia64/Makefile.inc |
---|
31,9 → 31,6 |
TARGET = ia64-pc-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin |
CFLAGS += -fno-unwind-tables -DMALLOC_ALIGNMENT_16 |
LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a |
AFLAGS += |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ |
arch/$(UARCH)/src/fibril.S \ |
40,5 → 37,10 |
arch/$(UARCH)/src/tls.c \ |
arch/$(UARCH)/src/ddi.c |
CFLAGS += -fno-unwind-tables -DMALLOC_ALIGNMENT_16 |
LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a |
ENDIANESS = LE |
BFD_NAME = elf64-ia64-little |
BFD_ARCH = ia64-elf64 |
/trunk/uspace/lib/libc/arch/arm32/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/arm32/Makefile.inc |
---|
32,9 → 32,6 |
TARGET = arm-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm/bin |
CFLAGS += -ffixed-r9 -mtp=soft |
LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a |
AFLAGS += |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ |
arch/$(UARCH)/src/fibril.S \ |
41,5 → 38,10 |
arch/$(UARCH)/src/tls.c \ |
arch/$(UARCH)/src/eabi.S |
CFLAGS += -ffixed-r9 -mtp=soft |
LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a |
ENDIANESS = LE |
BFD_NAME = elf32-littlearm |
BFD_ARCH = arm |
/trunk/uspace/lib/libc/arch/mips32eb/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/mips32eb/Makefile.inc |
---|
31,13 → 31,15 |
TARGET = mips-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips/bin |
CFLAGS += -mips3 |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c |
CFLAGS += -mips3 |
LFLAGS += -N |
ENDIANESS = BE |
BFD_ARCH = mips |
BFD_NAME = elf32-tradbigmips |
/trunk/uspace/lib/libc/arch/ppc32/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/ppc32/Makefile.inc |
---|
40,5 → 40,7 |
AFLAGS += -a32 |
LFLAGS += -N |
ENDIANESS = BE |
BFD_NAME = elf32-powerpc |
BFD_ARCH = powerpc:common |
/trunk/uspace/lib/libc/arch/amd64/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/amd64/Makefile.inc |
---|
38,5 → 38,7 |
LFLAGS += -N |
ENDIANESS = LE |
BFD_NAME = elf64-x86-64 |
BFD_ARCH = i386:x86-64 |
/trunk/uspace/lib/libc/arch/mips32/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/mips32/Makefile.inc |
---|
31,11 → 31,14 |
TARGET = mipsel-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/mipsel/bin |
CFLAGS += -mips3 |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c |
CFLAGS += -mips3 |
ENDIANESS = LE |
BFD_ARCH = mips |
BFD_NAME = elf32-tradlittlemips |
/trunk/uspace/lib/libc/arch/ia32/include/byteorder.h |
---|
File deleted |
/trunk/uspace/lib/libc/arch/ia32/Makefile.inc |
---|
39,5 → 39,7 |
LFLAGS += -N |
ENDIANESS = LE |
BFD_NAME = elf32-i386 |
BFD_ARCH = i386 |