Changeset 810a36f in mainline
- Timestamp:
- 2017-10-24T05:29:08Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b1eb7ef
- Parents:
- c8fbbe7 (diff), 673ea28 (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. - Files:
-
- 8 added
- 32 deleted
- 69 edited
- 8 moved
Legend:
- Unmodified
- Added
- Removed
-
abi/include/_bits/NULL.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcamd64 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ 32 36 /** @file 37 * Definition of constant NULL. 38 * 39 * This definition is designed to work in both C and C++, and use 40 * the special constant `nullptr` in C++11 and above. 41 * Including this file is preferrable to defining the constant separately. 33 42 */ 34 43 35 #ifndef LIBC_amd64_STDINT_H_36 #define LIBC_amd64_STDINT_H_44 #ifndef _BITS_NULL_H_ 45 #define _BITS_NULL_H_ 37 46 38 #i nclude <libarch/common.h>47 #ifndef NULL 39 48 40 #define SIZE_MIN UINT64_MIN 41 #define SIZE_MAX UINT64_MAX 49 #if __cplusplus >= 201103L 50 #define NULL nullptr 51 #elif defined(__cplusplus) 52 #define NULL 0L 53 #else 54 #define NULL ((void *) 0) 55 #endif 42 56 43 #define UINTPTR_MAX UINT64_MAX 44 typedef uint64_t uintptr_t; 45 46 #define INTPTR_MIN INT64_MIN 47 #define INTPTR_MAX INT64_MAX 48 typedef int64_t intptr_t; 49 50 #define UINTMAX_MAX UINT64_MAX 51 typedef uint64_t uintmax_t; 52 53 #define INTMAX_MAX INT64_MAX 54 typedef int64_t intmax_t; 57 #endif 55 58 56 59 #endif -
abi/include/_bits/WEOF.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcamd64 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ … … 33 37 */ 34 38 35 #ifndef LIBC_amd64_STDDEF_H_36 #define LIBC_amd64_STDDEF_H_39 #ifndef _BITS_WEOF_H_ 40 #define _BITS_WEOF_H_ 37 41 38 #include < libarch/common.h>42 #include <_bits/macros.h> 39 43 40 typedef uint64_t size_t; 41 typedef int64_t ssize_t; 42 typedef int64_t ptrdiff_t; 44 #define WEOF __WINT_EOF__ 43 45 44 46 #endif -
abi/include/_bits/all.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcamd64 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ … … 33 37 */ 34 38 35 #ifndef LIBC_amd64_TYPES_H_36 #define LIBC_amd64_TYPES_H_39 #ifndef _BITS_ALL_H_ 40 #define _BITS_ALL_H_ 37 41 38 #include <libarch/common.h> 39 #include <libarch/stddef.h> 40 #include <libarch/stdint.h> 41 42 #define __64_BITS__ 43 44 #define SSIZE_MIN INT64_MIN 45 #define SSIZE_MAX INT64_MAX 46 47 typedef uint64_t sysarg_t; 48 typedef int64_t native_t; 49 50 typedef uint64_t atomic_count_t; 51 typedef int64_t atomic_signed_t; 42 #include <_bits/inttypes.h> 43 #include <_bits/limits.h> 44 #include <_bits/native.h> 45 #include <_bits/ptrdiff_t.h> 46 #include <_bits/size_t.h> 47 #include <_bits/ssize_t.h> 48 #include <_bits/stdint.h> 49 #include <_bits/wchar_t.h> 50 #include <_bits/wint_t.h> 52 51 53 52 #endif -
abi/include/_bits/limits.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcarm32 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ … … 33 37 */ 34 38 35 #ifndef LIBC_arm32_STDINT_H_36 #define LIBC_arm32_STDINT_H_39 #ifndef _BITS_LIMITS_H_ 40 #define _BITS_LIMITS_H_ 37 41 38 #include < libarch/common.h>42 #include <_bits/macros.h> 39 43 40 #define SIZE_MIN UINT32_MIN 41 #define SIZE_MAX UINT32_MAX 44 /* _MIN macros for unsigned types are non-standard (and of course, always 0), 45 * but we already have them for some reason, so whatever. 46 */ 42 47 43 #define UINTPTR_MAX UINT32_MAX 44 typedef uint32_t uintptr_t; 48 #define CHAR_BIT __CHAR_BIT__ 45 49 46 #define INTPTR_MIN INT32_MIN 47 #define INTPTR_MAX INT32_MAX 48 typedef int32_t intptr_t; 50 #define SCHAR_MIN __SCHAR_MIN__ 51 #define SCHAR_MAX __SCHAR_MAX__ 49 52 50 #define U INTMAX_MAX UINT64_MAX51 typedef uint64_t uintmax_t; 53 #define UCHAR_MIN 0 54 #define UCHAR_MAX __UCHAR_MAX__ 52 55 53 #define INTMAX_MAX INT64_MAX 54 typedef int64_t intmax_t; 56 #define CHAR_MIN __CHAR_MIN__ 57 #define CHAR_MAX __CHAR_MAX__ 58 59 #define MB_LEN_MAX 16 60 61 #define SHRT_MIN __SHRT_MIN__ 62 #define SHRT_MAX __SHRT_MAX__ 63 64 #define USHRT_MIN 0 65 #define USHRT_MAX __USHRT_MAX__ 66 67 #define INT_MIN __INT_MIN__ 68 #define INT_MAX __INT_MAX__ 69 70 #define UINT_MIN 0U 71 #define UINT_MAX __UINT_MAX__ 72 73 #define LONG_MIN __LONG_MIN__ 74 #define LONG_MAX __LONG_MAX__ 75 76 #define ULONG_MIN 0UL 77 #define ULONG_MAX __ULONG_MAX__ 78 79 #define LLONG_MIN __LLONG_MIN__ 80 #define LLONG_MAX __LLONG_MAX__ 81 82 #define ULLONG_MIN 0ULL 83 #define ULLONG_MAX __ULLONG_MAX__ 55 84 56 85 #endif -
abi/include/_bits/native.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcabs32 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ 32 36 /** @file 37 * A bunch of type aliases HelenOS code uses. 38 * 39 * They were originally defined as either u/int32_t or u/int64_t, 40 * specifically for each architecture, but in practice they are 41 * currently assumed to be identical to u/intptr_t, so we do just that. 33 42 */ 34 43 35 #ifndef LIBC_abs32_STDINT_H_36 #define LIBC_abs32_STDINT_H_44 #ifndef _BITS_NATIVE_H_ 45 #define _BITS_NATIVE_H_ 37 46 38 #include < libarch/common.h>47 #include <_bits/macros.h> 39 48 40 #define SIZE_MAX UINT32_MAX 49 #define ATOMIC_COUNT_MIN __UINTPTR_MIN__ 50 #define ATOMIC_COUNT_MAX __UINTPTR_MAX__ 41 51 42 #define UINTPTR_MAX UINT32_MAX 43 typedef uint32_t uintptr_t; 52 typedef __UINTPTR_TYPE__ pfn_t; 53 typedef __UINTPTR_TYPE__ ipl_t; 54 typedef __UINTPTR_TYPE__ sysarg_t; 55 typedef __INTPTR_TYPE__ native_t; 56 typedef __UINTPTR_TYPE__ atomic_count_t; 57 typedef __INTPTR_TYPE__ atomic_signed_t; 44 58 45 #define INTPTR_MIN INT32_MIN 46 #define INTPTR_MAX INT32_MAX 47 typedef int32_t intptr_t; 48 49 #define UINTMAX_MAX UINT64_MAX 50 typedef uint64_t uintmax_t; 51 52 #define INTMAX_MAX INT64_MAX 53 typedef int64_t intmax_t; 59 #define PRIdn __PRIdPTR__ /**< Format for native_t. */ 60 #define PRIun __PRIuPTR__ /**< Format for sysarg_t. */ 61 #define PRIxn __PRIxPTR__ /**< Format for hexadecimal sysarg_t. */ 62 #define PRIua __PRIuPTR__ /**< Format for atomic_count_t. */ 54 63 55 64 #endif -
abi/include/_bits/size_t.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcabs32 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ … … 33 37 */ 34 38 35 #ifndef LIBC_abs32_STDDEF_H_36 #define LIBC_abs32_STDDEF_H_39 #ifndef _BITS_SIZE_T_H_ 40 #define _BITS_SIZE_T_H_ 37 41 38 #include < libarch/common.h>42 #include <_bits/macros.h> 39 43 40 typedef uint32_t size_t; 41 typedef int32_t ssize_t; 42 typedef int32_t ptrdiff_t; 44 typedef __SIZE_TYPE__ size_t; 43 45 44 46 #endif -
abi/include/_bits/wchar_t.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcarm32 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ … … 33 37 */ 34 38 35 #ifndef LIBC_arm32_STDDEF_H_36 #define LIBC_arm32_STDDEF_H_39 #ifndef _BITS_WCHAR_T_H_ 40 #define _BITS_WCHAR_T_H_ 37 41 38 #include < libarch/common.h>42 #include <_bits/macros.h> 39 43 40 typedef uint32_t size_t; 41 typedef int32_t ssize_t; 42 typedef int32_t ptrdiff_t; 44 typedef __WCHAR_TYPE__ wchar_t; 43 45 44 46 #endif -
abi/include/_bits/wint_t.h
rc8fbbe7 r810a36f 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2017 CZ.NIC, z.s.p.o. 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcia32 29 /* Authors: 30 * Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com> 31 */ 32 33 /** @addtogroup bits 30 34 * @{ 31 35 */ … … 33 37 */ 34 38 35 #ifndef LIBC_ia32_STDDEF_H_36 #define LIBC_ia32_STDDEF_H_39 #ifndef _BITS_WINT_T_H_ 40 #define _BITS_WINT_T_H_ 37 41 38 #include < libarch/common.h>42 #include <_bits/macros.h> 39 43 40 typedef uint32_t size_t; 41 typedef int32_t ssize_t; 42 typedef int32_t ptrdiff_t; 44 typedef __WINT_TYPE__ wint_t; 43 45 44 46 #endif -
boot/Makefile.build
rc8fbbe7 r810a36f 109 109 endif 110 110 111 depend: $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $( COMMON_HEADER_ARCH) $(PRE_DEPEND)111 depend: $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(PRE_DEPEND) 112 112 113 113 $(COMPS).s: $(COMPS).zip … … 133 133 $(GENARCH_INCLUDE) $(GENARCH_INCLUDE)/%.h: genarch/include/ 134 134 ln -sfn ../../$< $@ 135 136 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)137 ln -sfn ../../../$< $@ -
boot/Makefile.common
rc8fbbe7 r810a36f 36 36 COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common 37 37 COMMON_HEADER = $(ROOT_PATH)/common.h 38 COMMON_HEADER_ARCH = arch/$(BARCH)/include/common.h39 38 40 39 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config -
boot/arch/arm32/include/types.h
rc8fbbe7 r810a36f 37 37 #define BOOT_arm32_TYPES_H 38 38 39 #include < arch/common.h>39 #include <_bits/all.h> 40 40 41 41 #define TASKMAP_MAX_RECORDS 32 42 42 #define BOOTINFO_TASK_NAME_BUFLEN 32 43 44 typedef uint32_t size_t;45 typedef uint32_t uintptr_t;46 47 typedef uint32_t pfn_t;48 49 typedef int32_t ptrdiff_t;50 43 51 44 typedef struct { -
boot/arch/ia64/include/types.h
rc8fbbe7 r810a36f 30 30 #define BOOT_ia64_TYPES_H_ 31 31 32 #include < arch/common.h>32 #include <_bits/all.h> 33 33 34 34 #define TASKMAP_MAX_RECORDS 32 35 35 #define BOOTINFO_TASK_NAME_BUFLEN 32 36 36 #define MEMMAP_ITEMS 128 37 38 typedef uint64_t size_t;39 typedef uint64_t sysarg_t;40 typedef uint64_t uintptr_t;41 42 typedef int64_t ptrdiff_t;43 37 44 38 typedef struct { -
boot/arch/mips32/include/types.h
rc8fbbe7 r810a36f 30 30 #define BOOT_mips32_TYPES_H_ 31 31 32 #include < arch/common.h>32 #include <_bits/all.h> 33 33 34 34 #define TASKMAP_MAX_RECORDS 32 35 35 #define CPUMAP_MAX_RECORDS 32 36 36 #define BOOTINFO_TASK_NAME_BUFLEN 32 37 38 typedef uint32_t size_t;39 typedef uint32_t uintptr_t;40 41 typedef int32_t ptrdiff_t;42 37 43 38 typedef struct { -
boot/arch/ppc32/include/types.h
rc8fbbe7 r810a36f 30 30 #define BOOT_ppc32_TYPES_H_ 31 31 32 #include < arch/common.h>32 #include <_bits/all.h> 33 33 34 34 #define TASKMAP_MAX_RECORDS 32 35 35 #define BOOTINFO_TASK_NAME_BUFLEN 32 36 37 typedef uint32_t size_t;38 typedef uint32_t uintptr_t;39 typedef uint32_t sysarg_t;40 typedef int32_t native_t;41 42 typedef int32_t ptrdiff_t;43 36 44 37 typedef struct { -
boot/arch/riscv64/include/types.h
rc8fbbe7 r810a36f 30 30 #define BOOT_riscv64_TYPES_H_ 31 31 32 #include < arch/common.h>32 #include <_bits/all.h> 33 33 34 34 #define MEMMAP_MAX_RECORDS 32 35 35 #define TASKMAP_MAX_RECORDS 32 36 36 #define BOOTINFO_TASK_NAME_BUFLEN 32 37 38 typedef uint64_t size_t;39 typedef uint64_t uintptr_t;40 41 typedef int64_t ptrdiff_t;42 37 43 38 typedef struct { -
boot/arch/sparc64/include/types.h
rc8fbbe7 r810a36f 30 30 #define BOOT_sparc64_TYPES_H_ 31 31 32 #include < arch/common.h>32 #include <_bits/all.h> 33 33 34 34 #define TASKMAP_MAX_RECORDS 32 35 35 #define BOOTINFO_TASK_NAME_BUFLEN 32 36 37 typedef uint64_t size_t;38 typedef uint64_t uintptr_t;39 typedef uint64_t sysarg_t;40 typedef int64_t native_t;41 42 typedef int64_t ptrdiff_t;43 36 44 37 typedef struct { -
boot/generic/include/stddef.h
rc8fbbe7 r810a36f 33 33 #define BOOT_STDDEF_H_ 34 34 35 #include <arch/common.h>36 35 #include <arch/types.h> 37 36 38 # define NULL ((void *) 0)37 #include <_bits/NULL.h> 39 38 40 39 #endif -
boot/generic/include/stdint.h
rc8fbbe7 r810a36f 33 33 #define BOOT_STDINT_H_ 34 34 35 #include <arch/common.h>36 35 #include <arch/types.h> 37 38 #define INT8_MIN INT8_C(0x80)39 #define INT8_MAX INT8_C(0x7F)40 41 #define UINT8_MIN UINT8_C(0)42 #define UINT8_MAX UINT8_C(0xFF)43 44 #define INT16_MIN INT16_C(0x8000)45 #define INT16_MAX INT16_C(0x7FFF)46 47 #define UINT16_MIN UINT16_C(0)48 #define UINT16_MAX UINT16_C(0xFFFF)49 50 #define INT32_MIN INT32_C(0x80000000)51 #define INT32_MAX INT32_C(0x7FFFFFFF)52 53 #define UINT32_MIN UINT32_C(0)54 #define UINT32_MAX UINT32_C(0xFFFFFFFF)55 56 #define INT64_MIN INT64_C(0x8000000000000000)57 #define INT64_MAX INT64_C(0x7FFFFFFFFFFFFFFF)58 59 #define UINT64_MIN UINT64_C(0)60 #define UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF)61 36 62 37 #endif -
boot/generic/src/printf_core.c
rc8fbbe7 r810a36f 101 101 PrintfQualifierLongLong, 102 102 PrintfQualifierPointer, 103 PrintfQualifierSize 103 PrintfQualifierSize, 104 PrintfQualifierMax 104 105 } qualifier_t; 105 106 … … 643 644 uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 644 645 break; 646 case 'j': 647 qualifier = PrintfQualifierMax; 648 i = nxt; 649 uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 650 break; 645 651 default: 646 652 /* Default type */ … … 759 765 number = (uint64_t) va_arg(ap, size_t); 760 766 break; 767 case PrintfQualifierMax: 768 size = sizeof(uintmax_t); 769 number = (uint64_t) va_arg(ap, uintmax_t); 770 break; 761 771 default: 762 772 /* Unknown qualifier */ -
boot/generic/src/str.c
rc8fbbe7 r810a36f 104 104 105 105 /** Check the condition if wchar_t is signed */ 106 #ifdef WCHAR_IS_UNSIGNED106 #ifdef __WCHAR_UNSIGNED__ 107 107 #define WCHAR_SIGNED_CHECK(cond) (true) 108 108 #else -
kernel/Makefile
rc8fbbe7 r810a36f 458 458 done 459 459 460 depend: $(COMMON_HEADER_ARCH) $(AUTOGENS_H) 461 462 $(COMMON_HEADER_ARCH): $(COMMON_HEADER) 463 ln -sfn ../../../../$< $@ 460 depend: $(AUTOGENS_H) 464 461 465 462 autogen_clean: -
kernel/arch/abs32le/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_abs32le_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 #define ATOMIC_COUNT_MIN UINT32_MIN 41 #define ATOMIC_COUNT_MAX UINT32_MAX 42 43 typedef uint32_t size_t; 44 typedef int32_t ssize_t; 45 46 typedef uint32_t uintptr_t; 47 typedef uint32_t pfn_t; 48 49 typedef uint32_t ipl_t; 50 51 typedef uint32_t sysarg_t; 52 typedef int32_t native_t; 53 typedef uint32_t atomic_count_t; 38 #include <_bits/all.h> 54 39 55 40 typedef struct { 56 41 } fncptr_t; 57 58 #define PRIdn PRId32 /**< Format for native_t. */59 #define PRIun PRIu32 /**< Format for sysarg_t. */60 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t. */61 #define PRIua PRIu32 /**< Format for atomic_count_t. */62 42 63 43 #endif -
kernel/arch/amd64/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_amd64_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 typedef uint64_t size_t; 41 typedef int64_t ssize_t; 42 43 typedef uint64_t uintptr_t; 44 typedef uint64_t pfn_t; 45 46 typedef uint64_t ipl_t; 47 48 typedef uint64_t sysarg_t; 49 typedef int64_t native_t; 50 typedef uint64_t atomic_count_t; 38 #include <_bits/all.h> 51 39 52 40 typedef struct { 53 41 } fncptr_t; 54 55 #define PRIdn PRId64 /**< Format for native_t. */56 #define PRIun PRIu64 /**< Format for sysarg_t. */57 #define PRIxn PRIx64 /**< Format for hexadecimal sysarg_t. */58 #define PRIua PRIu64 /**< Format for atomic_count_t. */59 42 60 43 #endif -
kernel/arch/arm32/include/arch/types.h
rc8fbbe7 r810a36f 37 37 #define KERN_arm32_TYPES_H_ 38 38 39 #include <arch/common.h>40 41 39 #ifndef DOXYGEN 42 40 #define ATTRIBUTE_PACKED __attribute__((packed)) … … 45 43 #endif 46 44 47 typedef uint32_t size_t; 48 typedef int32_t ssize_t; 49 50 typedef uint32_t uintptr_t; 51 typedef uint32_t pfn_t; 52 53 typedef uint32_t ipl_t; 54 55 typedef uint32_t sysarg_t; 56 typedef int32_t native_t; 57 typedef uint32_t atomic_count_t; 45 #include <_bits/all.h> 58 46 59 47 typedef struct { 60 48 } fncptr_t; 61 62 #define PRIdn PRId32 /**< Format for native_t. */63 #define PRIun PRIu32 /**< Format for sysarg_t. */64 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t. */65 #define PRIua PRIu32 /**< Format for atomic_count_t. */66 49 67 50 #endif -
kernel/arch/ia32/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_ia32_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 typedef uint32_t size_t; 41 typedef int32_t ssize_t; 42 43 typedef uint32_t uintptr_t; 44 typedef uint32_t pfn_t; 45 46 typedef uint32_t ipl_t; 47 48 typedef uint32_t sysarg_t; 49 typedef int32_t native_t; 50 typedef uint32_t atomic_count_t; 38 #include <_bits/all.h> 51 39 52 40 typedef struct { 53 41 } fncptr_t; 54 55 #define PRIdn PRId32 /**< Format for native_t. */56 #define PRIun PRIu32 /**< Format for sysarg_t. */57 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t. */58 #define PRIua PRIu32 /**< Format for atomic_count_t. */59 42 60 43 #endif -
kernel/arch/ia32/src/interrupt.c
rc8fbbe7 r810a36f 88 88 istate->esi, istate->edi, istate->ebp, 89 89 istate_from_uspace(istate) ? istate->esp : 90 (uint ptr_t) &istate->esp);90 (uint32_t) &istate->esp); 91 91 } 92 92 -
kernel/arch/ia64/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_ia64_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 typedef uint64_t size_t; 41 typedef int64_t ssize_t; 42 43 typedef uint64_t uintptr_t; 44 typedef uint64_t pfn_t; 45 46 typedef uint64_t ipl_t; 47 48 typedef uint64_t sysarg_t; 49 typedef int64_t native_t; 50 typedef uint64_t atomic_count_t; 38 #include <_bits/all.h> 51 39 52 40 typedef struct { … … 55 43 } __attribute__((may_alias)) fncptr_t; 56 44 57 #define PRIdn PRId64 /**< Format for native_t. */58 #define PRIun PRIu64 /**< Format for sysarg_t. */59 #define PRIxn PRIx64 /**< Format for hexadecimal sysarg_t. */60 #define PRIua PRIu64 /**< Format for atomic_count_t. */61 62 45 #endif 63 46 -
kernel/arch/ia64/src/interrupt.c
rc8fbbe7 r810a36f 142 142 istate->cr_isr.value, istate->cr_ipsr.value); 143 143 144 printf("cr.iip=%#0" PRIx 64", #%u\t(%s)\n",144 printf("cr.iip=%#0" PRIxPTR ", #%u\t(%s)\n", 145 145 istate->cr_iip, istate->cr_isr.ei, 146 146 symtab_fmt_name_lookup(istate->cr_iip)); 147 printf("cr.iipa=%#0" PRIx 64"\t(%s)\n", istate->cr_iipa,147 printf("cr.iipa=%#0" PRIxPTR "\t(%s)\n", istate->cr_iipa, 148 148 symtab_fmt_name_lookup(istate->cr_iipa)); 149 printf("cr.ifa=%#0" PRIx 64"\t(%s)\n", istate->cr_ifa,149 printf("cr.ifa=%#0" PRIxPTR "\t(%s)\n", istate->cr_ifa, 150 150 symtab_fmt_name_lookup(istate->cr_ifa)); 151 151 } -
kernel/arch/mips32/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_mips32_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 typedef uint32_t size_t; 41 typedef int32_t ssize_t; 42 43 typedef uint32_t uintptr_t; 44 typedef uint32_t pfn_t; 45 46 typedef uint32_t ipl_t; 47 48 typedef uint32_t sysarg_t; 49 typedef int32_t native_t; 50 typedef uint32_t atomic_count_t; 38 #include <_bits/all.h> 51 39 52 40 typedef struct { 53 41 } fncptr_t; 54 55 #define PRIdn PRId32 /**< Format for native_t. */56 #define PRIun PRIu32 /**< Format for sysarg_t. */57 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t. */58 #define PRIua PRIu32 /**< Format for atomic_count_t. */59 42 60 43 #endif -
kernel/arch/ppc32/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_ppc32_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 typedef uint32_t size_t; 41 typedef int32_t ssize_t; 42 43 typedef uint32_t uintptr_t; 44 typedef uint32_t pfn_t; 45 46 typedef uint32_t ipl_t; 47 48 typedef uint32_t sysarg_t; 49 typedef int32_t native_t; 50 typedef uint32_t atomic_count_t; 38 #include <_bits/all.h> 51 39 52 40 typedef struct { 53 41 } fncptr_t; 54 55 #define PRIdn PRId32 /**< Format for native_t. */56 #define PRIun PRIu32 /**< Format for sysarg_t. */57 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t. */58 #define PRIua PRIu32 /**< Format for atomic_count_t. */59 42 60 43 #endif -
kernel/arch/riscv64/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_riscv64_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 typedef uint64_t size_t; 41 typedef int64_t ssize_t; 42 43 typedef uint64_t uintptr_t; 44 typedef uint64_t pfn_t; 45 46 typedef uint64_t ipl_t; 47 48 typedef uint64_t sysarg_t; 49 typedef int64_t native_t; 50 typedef uint64_t atomic_count_t; 38 #include <_bits/all.h> 51 39 52 40 typedef struct { 53 41 } fncptr_t; 54 55 #define PRIdn PRId64 /**< Format for native_t. */56 #define PRIun PRIu64 /**< Format for sysarg_t. */57 #define PRIxn PRIx64 /**< Format for hexadecimal sysarg_t. */58 #define PRIua PRIu64 /**< Format for atomic_count_t. */59 42 60 43 #endif -
kernel/arch/sparc64/include/arch/asm.h
rc8fbbe7 r810a36f 350 350 351 351 pstate.value = pstate_read(); 352 pstate.ie = ((pstate_reg_t) ipl).ie;352 pstate.ie = ((pstate_reg_t)(uint64_t) ipl).ie; 353 353 pstate_write(pstate.value); 354 354 } -
kernel/arch/sparc64/include/arch/barrier.h
rc8fbbe7 r810a36f 37 37 38 38 #include <trace.h> 39 40 #ifdef KERNEL41 #include <arch/common.h>42 #else43 #include <libarch/common.h>44 #endif45 39 46 40 /* … … 88 82 NO_TRACE static inline void flush_pipeline(void) 89 83 { 90 u int64_tpc;84 unsigned long pc; 91 85 92 86 /* -
kernel/arch/sparc64/include/arch/mm/sun4v/tsb.h
rc8fbbe7 r810a36f 72 72 struct pte; 73 73 74 extern void tsb_invalidate(struct as *as, uintptr_t page, uint64_t pages);74 extern void tsb_invalidate(struct as *as, uintptr_t page, size_t pages); 75 75 extern void itsb_pte_copy(struct pte *t); 76 76 extern void dtsb_pte_copy(struct pte *t, bool ro); -
kernel/arch/sparc64/include/arch/types.h
rc8fbbe7 r810a36f 36 36 #define KERN_sparc64_TYPES_H_ 37 37 38 #include <arch/common.h> 39 40 typedef uint64_t size_t; 41 typedef int64_t ssize_t; 42 43 typedef uint64_t uintptr_t; 44 typedef uint64_t pfn_t; 45 46 typedef uint64_t ipl_t; 47 48 typedef uint64_t sysarg_t; 49 typedef int64_t native_t; 50 typedef uint64_t atomic_count_t; 38 #include <_bits/all.h> 51 39 52 40 typedef struct { … … 55 43 typedef uint8_t asi_t; 56 44 57 #define PRIdn PRId64 /**< Format for native_t. */58 #define PRIun PRIu64 /**< Format for sysarg_t. */59 #define PRIxn PRIx64 /**< Format for hexadecimal sysarg_t. */60 #define PRIua PRIu64 /**< Format for atomic_count_t. */61 62 45 #endif 63 46 -
kernel/generic/include/stddef.h
rc8fbbe7 r810a36f 38 38 #include <arch/types.h> 39 39 40 typedef native_t ptrdiff_t; 41 42 #ifndef NULL 43 #define NULL ((void *) 0) 44 #endif 40 #include <_bits/NULL.h> 45 41 46 42 #define offsetof(type,member) ((size_t) &(((type *) 0)->member)) -
kernel/generic/include/stdint.h
rc8fbbe7 r810a36f 36 36 #define KERN_STDINT_H_ 37 37 38 #include <arch/common.h> 39 40 #define INT8_MIN INT8_C(0x80) 41 #define INT8_MAX INT8_C(0x7F) 42 43 #define UINT8_MIN UINT8_C(0) 44 #define UINT8_MAX UINT8_C(0xFF) 45 46 #define INT16_MIN INT16_C(0x8000) 47 #define INT16_MAX INT16_C(0x7FFF) 48 49 #define UINT16_MIN UINT16_C(0) 50 #define UINT16_MAX UINT16_C(0xFFFF) 51 52 #define INT32_MIN INT32_C(0x80000000) 53 #define INT32_MAX INT32_C(0x7FFFFFFF) 54 55 #define UINT32_MIN UINT32_C(0) 56 #define UINT32_MAX UINT32_C(0xFFFFFFFF) 57 58 #define INT64_MIN INT64_C(0x8000000000000000) 59 #define INT64_MAX INT64_C(0x7FFFFFFFFFFFFFFF) 60 61 #define UINT64_MIN UINT64_C(0) 62 #define UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF) 38 #include <_bits/stdint.h> 63 39 64 40 #endif -
kernel/generic/include/typedefs.h
rc8fbbe7 r810a36f 36 36 #define KERN_TYPEDEFS_H_ 37 37 38 #include <stdint.h>39 #include <arch/common.h>40 38 #include <arch/types.h> 41 39 -
kernel/generic/src/debug/panic.c
rc8fbbe7 r810a36f 62 62 printf("\n"); 63 63 } else if (cat == PANIC_BADTRAP) { 64 printf("bad trap %" PRIu n". %s\n", address,64 printf("bad trap %" PRIuPTR ". %s\n", address, 65 65 BANNER_RIGHT); 66 66 if (fmt) { … … 96 96 printf("THE=%p: ", THE); 97 97 if (THE != NULL) { 98 printf("pe=%" PRIu n" thread=%p task=%p cpu=%p as=%p"98 printf("pe=%" PRIuPTR " thread=%p task=%p cpu=%p as=%p" 99 99 " magic=%#" PRIx32 "\n", THE->preemption, 100 100 THE->thread, THE->task, THE->cpu, THE->as, THE->magic); -
kernel/generic/src/lib/ra.c
rc8fbbe7 r810a36f 353 353 link = hash_table_find(&span->used, &key); 354 354 if (!link) { 355 panic("Freeing segment which is not known to be used (base=% "356 PRIxn ", size=%" PRIdn ").", base, size);355 panic("Freeing segment which is not known to be used (base=%zx" 356 ", size=%zd).", base, size); 357 357 } 358 358 seg = hash_table_get_inst(link, ra_segment_t, uh_link); … … 447 447 irq_spinlock_unlock(&arena->lock, true); 448 448 449 panic("Freeing to wrong arena (base=%" PRIx n ", size=%" PRIdn ").",449 panic("Freeing to wrong arena (base=%" PRIxPTR ", size=%zd).", 450 450 base, size); 451 451 } -
kernel/generic/src/lib/str.c
rc8fbbe7 r810a36f 114 114 115 115 /** Check the condition if wchar_t is signed */ 116 #ifdef WCHAR_IS_UNSIGNED116 #ifdef __WCHAR_UNSIGNED__ 117 117 #define WCHAR_SIGNED_CHECK(cond) (true) 118 118 #else -
kernel/generic/src/mm/backend_user.c
rc8fbbe7 r810a36f 129 129 if (rc != EOK) { 130 130 log(LF_USPACE, LVL_FATAL, 131 "Page-in request for page %#" PRIx n131 "Page-in request for page %#" PRIxPTR 132 132 " at pager %d failed with error %d.", 133 133 upage, pager_info->pager, rc); -
kernel/generic/src/printf/printf_core.c
rc8fbbe7 r810a36f 104 104 PrintfQualifierLongLong, 105 105 PrintfQualifierPointer, 106 PrintfQualifierSize 106 PrintfQualifierSize, 107 PrintfQualifierMax 107 108 } qualifier_t; 108 109 … … 767 768 case 'z': 768 769 qualifier = PrintfQualifierSize; 770 i = nxt; 771 uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 772 break; 773 case 'j': 774 qualifier = PrintfQualifierMax; 769 775 i = nxt; 770 776 uc = str_decode(fmt, &nxt, STR_NO_LIMIT); … … 892 898 number = (uint64_t) va_arg(ap, size_t); 893 899 break; 900 case PrintfQualifierMax: 901 size = sizeof(uintmax_t); 902 number = (uint64_t) va_arg(ap, uintmax_t); 903 break; 894 904 default: 895 905 /* Unknown qualifier */ -
tools/autotool.py
rc8fbbe7 r810a36f 1 #!/usr/bin/env python 1 #!/usr/bin/env python2 2 2 # 3 3 # Copyright (c) 2010 Martin Decky … … 43 43 MAKEFILE = 'Makefile.common' 44 44 HEADER = 'common.h.new' 45 GUARD = ' AUTOTOOL_COMMON_H_'45 GUARD = '_AUTOTOOL_COMMON_H_' 46 46 47 47 PROBE_SOURCE = 'probe.c' 48 48 PROBE_OUTPUT = 'probe.s' 49 50 PROBE_INT128_SOURCE = 'probe_int128.c'51 PROBE_INT128_OUTPUT = 'probe_int128.s'52 49 53 50 PACKAGE_BINUTILS = "usually part of binutils" … … 59 56 COMPILER_WARNING = "The compilation of HelenOS might fail." 60 57 61 PROBE_HEAD = """#define AUTOTOOL_DECLARE(category, subcategory, tag, name, strc, conc, value) \\58 PROBE_HEAD = """#define AUTOTOOL_DECLARE(category, tag, name, signedness, base, size, compatible) \\ 62 59 asm volatile ( \\ 63 "AUTOTOOL_DECLARE\\t" category "\\t" subcategory "\\t" tag "\\t" name "\\t" strc "\\t" conc "\\t%[val]\\n" \\60 "AUTOTOOL_DECLARE\\t" category "\\t" tag "\\t" name "\\t" signedness "\\t" base "\\t%[size_val]\\t%[cmp_val]\\n" \\ 64 61 : \\ 65 : [ val] "n" (value) \\62 : [size_val] "n" (size), [cmp_val] "n" (compatible) \\ 66 63 ) 67 64 … … 70 67 71 68 #define DECLARE_BUILTIN_TYPE(tag, type) \\ 72 AUTOTOOL_DECLARE("builtin_size", "", tag, STRING(type), "", "", sizeof(type)); \\ 73 AUTOTOOL_DECLARE("builtin_sign", "unsigned long long int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned long long int)); \\ 74 AUTOTOOL_DECLARE("builtin_sign", "unsigned long int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned long int)); \\ 75 AUTOTOOL_DECLARE("builtin_sign", "unsigned int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned int)); \\ 76 AUTOTOOL_DECLARE("builtin_sign", "unsigned short int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned short int)); \\ 77 AUTOTOOL_DECLARE("builtin_sign", "unsigned char", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned char)); \\ 78 AUTOTOOL_DECLARE("builtin_sign", "signed long long int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed long long int)); \\ 79 AUTOTOOL_DECLARE("builtin_sign", "signed long int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed long int)); \\ 80 AUTOTOOL_DECLARE("builtin_sign", "signed int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed int)); \\ 81 AUTOTOOL_DECLARE("builtin_sign", "signed short int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed short int)); \\ 82 AUTOTOOL_DECLARE("builtin_sign", "signed char", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed char)); 83 84 #define DECLARE_INTSIZE(tag, type, strc, conc) \\ 85 AUTOTOOL_DECLARE("intsize", "unsigned", tag, #type, strc, conc, sizeof(unsigned type)); \\ 86 AUTOTOOL_DECLARE("intsize", "signed", tag, #type, strc, conc, sizeof(signed type)); 87 88 #define DECLARE_FLOATSIZE(tag, type) \\ 89 AUTOTOOL_DECLARE("floatsize", "", tag, #type, "", "", sizeof(type)); 90 91 extern int main(int, char *[]); 92 93 int main(int argc, char *argv[]) 94 { 95 #ifdef __SIZE_TYPE__ 96 DECLARE_BUILTIN_TYPE("size", __SIZE_TYPE__); 97 #endif 98 #ifdef __WCHAR_TYPE__ 99 DECLARE_BUILTIN_TYPE("wchar", __WCHAR_TYPE__); 100 #endif 101 #ifdef __WINT_TYPE__ 102 DECLARE_BUILTIN_TYPE("wint", __WINT_TYPE__); 103 #endif 104 """ 105 106 PROBE_TAIL = """} 107 """ 108 109 PROBE_INT128_HEAD = """#define AUTOTOOL_DECLARE(category, subcategory, tag, name, strc, conc, value) \\ 110 asm volatile ( \\ 111 "AUTOTOOL_DECLARE\\t" category "\\t" subcategory "\\t" tag "\\t" name "\\t" strc "\\t" conc "\\t%[val]\\n" \\ 112 : \\ 113 : [val] "n" (value) \\ 114 ) 115 116 #define DECLARE_INTSIZE(tag, type) \\ 117 AUTOTOOL_DECLARE("intsize", "unsigned", tag, #type, "", "", sizeof(unsigned type)); \\ 118 AUTOTOOL_DECLARE("intsize", "signed", tag, #type, "", "", sizeof(signed type)); 69 AUTOTOOL_DECLARE("unsigned long long int", tag, STRING(type), "unsigned", "long long", sizeof(type), __builtin_types_compatible_p(type, unsigned long long int)); \\ 70 AUTOTOOL_DECLARE("unsigned long int", tag, STRING(type), "unsigned", "long", sizeof(type), __builtin_types_compatible_p(type, unsigned long int)); \\ 71 AUTOTOOL_DECLARE("unsigned int", tag, STRING(type), "unsigned", "int", sizeof(type), __builtin_types_compatible_p(type, unsigned int)); \\ 72 AUTOTOOL_DECLARE("unsigned short int", tag, STRING(type), "unsigned", "short", sizeof(type), __builtin_types_compatible_p(type, unsigned short int)); \\ 73 AUTOTOOL_DECLARE("unsigned char", tag, STRING(type), "unsigned", "char", sizeof(type), __builtin_types_compatible_p(type, unsigned char)); \\ 74 AUTOTOOL_DECLARE("signed long long int", tag, STRING(type), "signed", "long long", sizeof(type), __builtin_types_compatible_p(type, signed long long int)); \\ 75 AUTOTOOL_DECLARE("signed long int", tag, STRING(type), "signed", "long", sizeof(type), __builtin_types_compatible_p(type, signed long int)); \\ 76 AUTOTOOL_DECLARE("signed int", tag, STRING(type), "signed", "int", sizeof(type), __builtin_types_compatible_p(type, signed int)); \\ 77 AUTOTOOL_DECLARE("signed short int", tag, STRING(type), "signed", "short", sizeof(type), __builtin_types_compatible_p(type, signed short int)); \\ 78 AUTOTOOL_DECLARE("signed char", tag, STRING(type), "signed", "char", sizeof(type), __builtin_types_compatible_p(type, signed char)); \\ 79 AUTOTOOL_DECLARE("pointer", tag, STRING(type), "N/A", "pointer", sizeof(type), __builtin_types_compatible_p(type, void*)); \\ 80 AUTOTOOL_DECLARE("long double", tag, STRING(type), "signed", "long double", sizeof(type), __builtin_types_compatible_p(type, long double)); \\ 81 AUTOTOOL_DECLARE("double", tag, STRING(type), "signed", "double", sizeof(type), __builtin_types_compatible_p(type, double)); \\ 82 AUTOTOOL_DECLARE("float", tag, STRING(type), "signed", "float", sizeof(type), __builtin_types_compatible_p(type, float)); 119 83 120 84 extern int main(int, char *[]); … … 124 88 """ 125 89 126 PROBE_ INT128_TAIL = """}90 PROBE_TAIL = """} 127 91 """ 128 92 … … 414 378 return int(value, base) 415 379 416 def probe_compiler(common, intsizes, floatsizes):380 def probe_compiler(common, typesizes): 417 381 "Generate, compile and parse probing source" 418 382 … … 422 386 outf.write(PROBE_HEAD) 423 387 424 for typedef in intsizes: 425 outf.write("\tDECLARE_INTSIZE(\"%s\", %s, %s, %s);\n" % (typedef['tag'], typedef['type'], typedef['strc'], typedef['conc'])) 426 427 for typedef in floatsizes: 428 outf.write("\tDECLARE_FLOATSIZE(\"%s\", %s);\n" % (typedef['tag'], typedef['type'])) 388 for typedef in typesizes: 389 if 'def' in typedef: 390 outf.write("#ifdef %s\n" % typedef['def']) 391 outf.write("\tDECLARE_BUILTIN_TYPE(\"%s\", %s);\n" % (typedef['tag'], typedef['type'])) 392 if 'def' in typedef: 393 outf.write("#endif\n") 429 394 430 395 outf.write(PROBE_TAIL) … … 457 422 inf.close() 458 423 459 unsigned_sizes = {} 460 signed_sizes = {} 461 462 unsigned_tags = {} 463 signed_tags = {} 464 465 unsigned_strcs = {} 466 signed_strcs = {} 467 468 unsigned_concs = {} 469 signed_concs = {} 470 471 float_tags = {} 472 473 builtin_sizes = {} 474 builtin_signs = {} 424 builtins = {} 475 425 476 426 for j in range(len(lines)): … … 479 429 if (len(tokens) > 0): 480 430 if (tokens[0] == "AUTOTOOL_DECLARE"): 481 if (len(tokens) < 7):431 if (len(tokens) < 8): 482 432 print_error(["Malformed declaration in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL]) 483 433 484 434 category = tokens[1] 485 subcategory= tokens[2]486 tag= tokens[3]487 name= tokens[4]488 strc= tokens[5]489 conc= tokens[6]490 value = tokens[7]435 tag = tokens[2] 436 name = tokens[3] 437 signedness = tokens[4] 438 base = tokens[5] 439 size = tokens[6] 440 compatible = tokens[7] 491 441 492 if (category == "intsize"): 493 try: 494 value_int = decode_value(value) 495 except: 496 print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL]) 497 498 if (subcategory == "unsigned"): 499 unsigned_sizes[value_int] = name 500 unsigned_tags[tag] = value_int 501 unsigned_strcs[value_int] = strc 502 unsigned_concs[value_int] = conc 503 elif (subcategory == "signed"): 504 signed_sizes[value_int] = name 505 signed_tags[tag] = value_int 506 signed_strcs[value_int] = strc 507 signed_concs[value_int] = conc 508 else: 509 print_error(["Unexpected keyword \"%s\" in \"%s\" on line %s." % (subcategory, PROBE_OUTPUT, j), COMPILER_FAIL]) 442 try: 443 compatible_int = decode_value(compatible) 444 size_int = decode_value(size) 445 except: 446 print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL]) 510 447 511 if (category == "floatsize"): 512 try: 513 value_int = decode_value(value) 514 except: 515 print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL]) 516 517 float_tags[tag] = value_int 518 519 if (category == "builtin_size"): 520 try: 521 value_int = decode_value(value) 522 except: 523 print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL]) 524 525 builtin_sizes[tag] = {'name': name, 'value': value_int} 526 527 if (category == "builtin_sign"): 528 try: 529 value_int = decode_value(value) 530 except: 531 print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL]) 532 533 if (value_int == 1): 534 if (not tag in builtin_signs): 535 builtin_signs[tag] = strc; 536 elif (builtin_signs[tag] != strc): 537 print_error(["Inconsistent builtin type detection in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL]) 538 539 return {'unsigned_sizes': unsigned_sizes, 'signed_sizes': signed_sizes, 'unsigned_tags': unsigned_tags, 'signed_tags': signed_tags, 'unsigned_strcs': unsigned_strcs, 'signed_strcs': signed_strcs, 'unsigned_concs': unsigned_concs, 'signed_concs': signed_concs, 'float_tags': float_tags, 'builtin_sizes': builtin_sizes, 'builtin_signs': builtin_signs} 540 541 def probe_int128(common): 542 "Generate, compile and parse probing source for 128-bit integers" 543 544 check_common(common, "CC") 545 546 outf = open(PROBE_INT128_SOURCE, 'w') 547 outf.write(PROBE_INT128_HEAD) 548 outf.write("\tDECLARE_INTSIZE(\"INT128\", int __attribute((mode(TI))));\n") 549 outf.write(PROBE_INT128_TAIL) 550 outf.close() 551 552 args = common['CC_AUTOGEN'].split(' ') 553 args.extend(["-S", "-o", PROBE_INT128_OUTPUT, PROBE_INT128_SOURCE]) 554 555 try: 556 sys.stderr.write("Checking whether the compiler has intrinsic support for 128-bit integers ... ") 557 output = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.PIPE).communicate() 558 except: 559 sys.stderr.write("no\n") 560 return False 561 562 if (not os.path.isfile(PROBE_INT128_OUTPUT)): 563 sys.stderr.write("no\n") 564 return False 565 566 inf = open(PROBE_INT128_OUTPUT, 'r') 567 lines = inf.readlines() 568 inf.close() 569 570 for j in range(len(lines)): 571 tokens = lines[j].strip().split("\t") 572 573 if (len(tokens) > 0): 574 if (tokens[0] == "AUTOTOOL_DECLARE"): 575 if (len(tokens) < 7): 576 print_error(["Malformed declaration in \"%s\" on line %s." % (PROBE_INT128_OUTPUT, j), COMPILER_FAIL]) 577 578 category = tokens[1] 579 subcategory = tokens[2] 580 tag = tokens[3] 581 name = tokens[4] 582 strc = tokens[5] 583 conc = tokens[6] 584 value = tokens[7] 585 586 if (category == "intsize"): 587 try: 588 value_int = decode_value(value) 589 except: 590 print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_INT128_OUTPUT, j), COMPILER_FAIL]) 591 592 if (subcategory == "unsigned"): 593 if (value_int != 16): 594 sys.stderr.write("no\n") 595 return False 596 elif (subcategory == "signed"): 597 if (value_int != 16): 598 sys.stderr.write("no\n") 599 return False 600 else: 601 print_error(["Unexpected keyword \"%s\" in \"%s\" on line %s." % (subcategory, PROBE_INT128_OUTPUT, j), COMPILER_FAIL]) 602 603 sys.stderr.write("yes\n") 604 return True 605 606 def detect_sizes(probe, bytes, inttags, floattags): 607 "Detect correct types for fixed-size types" 608 609 macros = [] 610 typedefs = [] 611 612 for b in bytes: 613 if (not b in probe['unsigned_sizes']): 614 print_error(['Unable to find appropriate unsigned integer type for %u bytes.' % b, 615 COMPILER_FAIL]) 616 617 if (not b in probe['signed_sizes']): 618 print_error(['Unable to find appropriate signed integer type for %u bytes.' % b, 619 COMPILER_FAIL]) 620 621 if (not b in probe['unsigned_strcs']): 622 print_error(['Unable to find appropriate unsigned printf formatter for %u bytes.' % b, 623 COMPILER_FAIL]) 624 625 if (not b in probe['signed_strcs']): 626 print_error(['Unable to find appropriate signed printf formatter for %u bytes.' % b, 627 COMPILER_FAIL]) 628 629 if (not b in probe['unsigned_concs']): 630 print_error(['Unable to find appropriate unsigned literal macro for %u bytes.' % b, 631 COMPILER_FAIL]) 632 633 if (not b in probe['signed_concs']): 634 print_error(['Unable to find appropriate signed literal macro for %u bytes.' % b, 635 COMPILER_FAIL]) 636 637 typedefs.append({'oldtype': "unsigned %s" % probe['unsigned_sizes'][b], 'newtype': "uint%u_t" % (b * 8)}) 638 typedefs.append({'oldtype': "signed %s" % probe['signed_sizes'][b], 'newtype': "int%u_t" % (b * 8)}) 639 640 macros.append({'oldmacro': "unsigned %s" % probe['unsigned_sizes'][b], 'newmacro': "UINT%u_T" % (b * 8)}) 641 macros.append({'oldmacro': "signed %s" % probe['signed_sizes'][b], 'newmacro': "INT%u_T" % (b * 8)}) 642 643 macros.append({'oldmacro': "\"%so\"" % probe['unsigned_strcs'][b], 'newmacro': "PRIo%u" % (b * 8)}) 644 macros.append({'oldmacro': "\"%su\"" % probe['unsigned_strcs'][b], 'newmacro': "PRIu%u" % (b * 8)}) 645 macros.append({'oldmacro': "\"%sx\"" % probe['unsigned_strcs'][b], 'newmacro': "PRIx%u" % (b * 8)}) 646 macros.append({'oldmacro': "\"%sX\"" % probe['unsigned_strcs'][b], 'newmacro': "PRIX%u" % (b * 8)}) 647 macros.append({'oldmacro': "\"%sd\"" % probe['signed_strcs'][b], 'newmacro': "PRId%u" % (b * 8)}) 648 649 name = probe['unsigned_concs'][b] 650 if ((name.startswith('@')) or (name == "")): 651 macros.append({'oldmacro': "c ## U", 'newmacro': "UINT%u_C(c)" % (b * 8)}) 652 else: 653 macros.append({'oldmacro': "c ## U%s" % name, 'newmacro': "UINT%u_C(c)" % (b * 8)}) 654 655 name = probe['unsigned_concs'][b] 656 if ((name.startswith('@')) or (name == "")): 657 macros.append({'oldmacro': "c", 'newmacro': "INT%u_C(c)" % (b * 8)}) 658 else: 659 macros.append({'oldmacro': "c ## %s" % name, 'newmacro': "INT%u_C(c)" % (b * 8)}) 660 661 for tag in inttags: 662 newmacro = "U%s" % tag 663 if (not tag in probe['unsigned_tags']): 664 print_error(['Unable to find appropriate size macro for %s.' % newmacro, 665 COMPILER_FAIL]) 666 667 oldmacro = "UINT%s" % (probe['unsigned_tags'][tag] * 8) 668 macros.append({'oldmacro': "%s_MIN" % oldmacro, 'newmacro': "%s_MIN" % newmacro}) 669 macros.append({'oldmacro': "%s_MAX" % oldmacro, 'newmacro': "%s_MAX" % newmacro}) 670 macros.append({'oldmacro': "1", 'newmacro': 'U%s_SIZE_%s' % (tag, probe['unsigned_tags'][tag] * 8)}) 671 672 newmacro = tag 673 if (not tag in probe['signed_tags']): 674 print_error(['Unable to find appropriate size macro for %s' % newmacro, 675 COMPILER_FAIL]) 676 677 oldmacro = "INT%s" % (probe['signed_tags'][tag] * 8) 678 macros.append({'oldmacro': "%s_MIN" % oldmacro, 'newmacro': "%s_MIN" % newmacro}) 679 macros.append({'oldmacro': "%s_MAX" % oldmacro, 'newmacro': "%s_MAX" % newmacro}) 680 macros.append({'oldmacro': "1", 'newmacro': '%s_SIZE_%s' % (tag, probe['signed_tags'][tag] * 8)}) 681 682 for tag in floattags: 683 if (not tag in probe['float_tags']): 684 print_error(['Unable to find appropriate size macro for %s' % tag, 685 COMPILER_FAIL]) 686 687 macros.append({'oldmacro': "1", 'newmacro': '%s_SIZE_%s' % (tag, probe['float_tags'][tag] * 8)}) 688 689 if (not 'size' in probe['builtin_signs']): 690 print_error(['Unable to determine whether size_t is signed or unsigned.', 448 if (compatible_int == 1): 449 builtins[tag] = { 450 'tag': tag, 451 'name': name, 452 'sign': signedness, 453 'base': base, 454 'size': size_int, 455 } 456 457 for typedef in typesizes: 458 if not typedef['tag'] in builtins: 459 print_error(['Unable to determine the properties of type %s.' % typedef['tag'], 691 460 COMPILER_FAIL]) 692 693 if (probe['builtin_signs']['size'] != 'unsigned'): 694 print_error(['The type size_t is not unsigned.', 695 COMPILER_FAIL]) 696 697 fnd = True 698 699 if (not 'wchar' in probe['builtin_sizes']): 700 print_warning(['The compiler does not provide the macro __WCHAR_TYPE__', 701 'for defining the compiler-native type wchar_t. We are', 702 'forced to define wchar_t as a hardwired type int32_t.', 703 COMPILER_WARNING]) 704 fnd = False 705 706 if (probe['builtin_sizes']['wchar']['value'] != 4): 707 print_warning(['The compiler provided macro __WCHAR_TYPE__ for defining', 708 'the compiler-native type wchar_t is not compliant with', 709 'HelenOS. We are forced to define wchar_t as a hardwired', 710 'type int32_t.', 711 COMPILER_WARNING]) 712 fnd = False 713 714 if (not fnd): 715 macros.append({'oldmacro': "int32_t", 'newmacro': "wchar_t"}) 461 if 'sname' in typedef: 462 builtins[typedef['tag']]['sname'] = typedef['sname'] 463 464 return builtins 465 466 def get_suffix(type): 467 if type['sign'] == 'unsigned': 468 return { 469 "char": "", 470 "short": "", 471 "int": "U", 472 "long": "UL", 473 "long long": "ULL", 474 }[type['base']] 716 475 else: 717 macros.append({'oldmacro': "__WCHAR_TYPE__", 'newmacro': "wchar_t"}) 718 719 if (not 'wchar' in probe['builtin_signs']): 720 print_error(['Unable to determine whether wchar_t is signed or unsigned.', 721 COMPILER_FAIL]) 722 723 if (probe['builtin_signs']['wchar'] == 'unsigned'): 724 macros.append({'oldmacro': "1", 'newmacro': 'WCHAR_IS_UNSIGNED'}) 725 if (probe['builtin_signs']['wchar'] == 'signed'): 726 macros.append({'oldmacro': "1", 'newmacro': 'WCHAR_IS_SIGNED'}) 727 728 fnd = True 729 730 if (not 'wint' in probe['builtin_sizes']): 731 print_warning(['The compiler does not provide the macro __WINT_TYPE__', 732 'for defining the compiler-native type wint_t. We are', 733 'forced to define wint_t as a hardwired type int32_t.', 734 COMPILER_WARNING]) 735 fnd = False 736 737 if (probe['builtin_sizes']['wint']['value'] != 4): 738 print_warning(['The compiler provided macro __WINT_TYPE__ for defining', 739 'the compiler-native type wint_t is not compliant with', 740 'HelenOS. We are forced to define wint_t as a hardwired', 741 'type int32_t.', 742 COMPILER_WARNING]) 743 fnd = False 744 745 if (not fnd): 746 macros.append({'oldmacro': "int32_t", 'newmacro': "wint_t"}) 747 else: 748 macros.append({'oldmacro': "__WINT_TYPE__", 'newmacro': "wint_t"}) 749 750 if (not 'wint' in probe['builtin_signs']): 751 print_error(['Unable to determine whether wint_t is signed or unsigned.', 752 COMPILER_FAIL]) 753 754 if (probe['builtin_signs']['wint'] == 'unsigned'): 755 macros.append({'oldmacro': "1", 'newmacro': 'WINT_IS_UNSIGNED'}) 756 if (probe['builtin_signs']['wint'] == 'signed'): 757 macros.append({'oldmacro': "1", 'newmacro': 'WINT_IS_SIGNED'}) 758 759 return {'macros': macros, 'typedefs': typedefs} 476 return { 477 "char": "", 478 "short": "", 479 "int": "", 480 "long": "L", 481 "long long": "LL", 482 }[type['base']] 483 484 def get_max(type): 485 val = (1 << (type['size']*8 - 1)) 486 if type['sign'] == 'unsigned': 487 val *= 2 488 return val - 1 489 490 def detect_sizes(probe): 491 "Detect properties of builtin types" 492 493 macros = {} 494 495 for type in probe.values(): 496 macros['__SIZEOF_%s__' % type['tag']] = type['size'] 497 498 if ('sname' in type): 499 macros['__%s_TYPE__' % type['sname']] = type['name'] 500 macros['__%s_WIDTH__' % type['sname']] = type['size']*8 501 macros['__%s_%s__' % (type['sname'], type['sign'].upper())] = "1" 502 macros['__%s_C_SUFFIX__' % type['sname']] = get_suffix(type) 503 macros['__%s_MAX__' % type['sname']] = "%d%s" % (get_max(type), get_suffix(type)) 504 505 if (probe['SIZE_T']['sign'] != 'unsigned'): 506 print_error(['The type size_t is not unsigned.', COMPILER_FAIL]) 507 508 return macros 760 509 761 510 def create_makefile(mkname, common): … … 777 526 outmk.close() 778 527 779 def create_header(hdname, ma ps, int128):528 def create_header(hdname, macros): 780 529 "Create header output" 781 530 … … 790 539 outhd.write('#define %s\n\n' % GUARD) 791 540 792 for macro in maps['macros']: 793 outhd.write('#define %s %s\n' % (macro['newmacro'], macro['oldmacro'])) 794 795 outhd.write('\n') 796 797 for typedef in maps['typedefs']: 798 outhd.write('typedef %s %s;\n' % (typedef['oldtype'], typedef['newtype'])) 799 800 if (int128): 801 outhd.write('typedef unsigned int __attribute((mode(TI))) uint128_t;\n') 802 outhd.write('typedef signed int __attribute((mode(TI))) int128_t;\n') 541 for macro in sorted(macros): 542 outhd.write('#ifndef %s\n' % macro) 543 outhd.write('#define %s %s\n' % (macro, macros[macro])) 544 outhd.write('#endif\n\n') 803 545 804 546 outhd.write('\n#endif\n') … … 916 658 probe = probe_compiler(common, 917 659 [ 918 {'type': 'long long int', 'tag': 'LLONG', 'strc': '"ll"', 'conc': '"LL"'}, 919 {'type': 'long int', 'tag': 'LONG', 'strc': '"l"', 'conc': '"L"'}, 920 {'type': 'int', 'tag': 'INT', 'strc': '""', 'conc': '""'}, 921 {'type': 'short int', 'tag': 'SHRT', 'strc': '"h"', 'conc': '"@"'}, 922 {'type': 'char', 'tag': 'CHAR', 'strc': '"hh"', 'conc': '"@@"'} 923 ], 924 [ 660 {'type': 'long long int', 'tag': 'LONG_LONG', 'sname': 'LLONG' }, 661 {'type': 'long int', 'tag': 'LONG', 'sname': 'LONG' }, 662 {'type': 'int', 'tag': 'INT', 'sname': 'INT' }, 663 {'type': 'short int', 'tag': 'SHORT', 'sname': 'SHRT'}, 664 {'type': 'void*', 'tag': 'POINTER'}, 925 665 {'type': 'long double', 'tag': 'LONG_DOUBLE'}, 926 666 {'type': 'double', 'tag': 'DOUBLE'}, 927 {'type': 'float', 'tag': 'FLOAT'} 667 {'type': 'float', 'tag': 'FLOAT'}, 668 {'type': '__SIZE_TYPE__', 'tag': 'SIZE_T', 'def': '__SIZE_TYPE__', 'sname': 'SIZE' }, 669 {'type': '__PTRDIFF_TYPE__', 'tag': 'PTRDIFF_T', 'def': '__PTRDIFF_TYPE__', 'sname': 'PTRDIFF' }, 670 {'type': '__WINT_TYPE__', 'tag': 'WINT_T', 'def': '__WINT_TYPE__', 'sname': 'WINT' }, 671 {'type': '__WCHAR_TYPE__', 'tag': 'WCHAR_T', 'def': '__WCHAR_TYPE__', 'sname': 'WCHAR' }, 672 {'type': '__INTMAX_TYPE__', 'tag': 'INTMAX_T', 'def': '__INTMAX_TYPE__', 'sname': 'INTMAX' }, 673 {'type': 'unsigned __INTMAX_TYPE__', 'tag': 'UINTMAX_T', 'def': '__INTMAX_TYPE__', 'sname': 'UINTMAX' }, 928 674 ] 929 675 ) 930 676 931 int128 = probe_int128(common) 932 933 maps = detect_sizes(probe, [1, 2, 4, 8], ['CHAR', 'SHRT', 'INT', 'LONG', 'LLONG'], ['LONG_DOUBLE', 'DOUBLE', 'FLOAT']) 677 macros = detect_sizes(probe) 934 678 935 679 finally: … … 939 683 940 684 create_makefile(MAKEFILE, common) 941 create_header(HEADER, ma ps, int128)685 create_header(HEADER, macros) 942 686 943 687 return 0 -
uspace/app/edit/search.c
rc8fbbe7 r810a36f 35 35 */ 36 36 37 #include <errno.h> 37 38 #include <stdlib.h> 38 39 #include <stddef.h> 39 #include < errno.h>40 #include <types/common.h> 40 41 41 42 #include "search.h" -
uspace/app/tester/float/softfloat1.c
rc8fbbe7 r810a36f 31 31 #include <stdbool.h> 32 32 #include <stddef.h> 33 #include <inttypes.h> 33 34 #include <mathtypes.h> 34 35 #include <add.h> -
uspace/app/tester/print/print4.c
rc8fbbe7 r810a36f 29 29 #include <stdio.h> 30 30 #include <stddef.h> 31 #include <wchar.h> 31 32 #include "../tester.h" 32 33 -
uspace/app/tester/util.h
rc8fbbe7 r810a36f 37 37 38 38 #include <stdio.h> 39 #include <inttypes.h> 39 40 #include "tester.h" 40 41 -
uspace/lib/bithenge/src/print.c
rc8fbbe7 r810a36f 40 40 #include <stdarg.h> 41 41 #include <stdio.h> 42 #include <wchar.h> 42 43 #include <bithenge/blob.h> 43 44 #include <bithenge/print.h> -
uspace/lib/c/Makefile
rc8fbbe7 r810a36f 32 32 33 33 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config 34 COMMON_HEADER_ARCH = arch/$(UARCH)/include/libarch/common.h35 34 36 35 LINKER_SCRIPTS = \ … … 40 39 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld 41 40 42 PRE_DEPEND = $(COMMON_HEADER_ARCH)41 PRE_DEPEND = 43 42 EXTRA_OUTPUT = $(LINKER_SCRIPTS) 44 EXTRA_CLEAN = $( COMMON_HEADER_ARCH) $(LINKER_SCRIPTS)43 EXTRA_CLEAN = $(LINKER_SCRIPTS) 45 44 LIBRARY = libc 46 45 SLIBRARY = libc.so.0.0 … … 208 207 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 209 208 $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@ 210 211 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)212 ln -sfn ../../../../$< $@ -
uspace/lib/c/arch/ia64/include/libarch/faddr.h
rc8fbbe7 r810a36f 38 38 #include <types/common.h> 39 39 40 typedef struct { 41 uintptr_t fnc; 42 uintptr_t gp; 43 } __attribute__((may_alias)) fncptr_t; 44 40 45 /** 41 46 * -
uspace/lib/c/generic/double_to_str.c
rc8fbbe7 r810a36f 32 32 #include <ieee_double.h> 33 33 34 #include <limits.h> 34 35 #include <stdint.h> 35 36 #include <stdbool.h> -
uspace/lib/c/generic/gsort.c
rc8fbbe7 r810a36f 41 41 42 42 #include <gsort.h> 43 #include <inttypes.h> 43 44 #include <mem.h> 44 45 #include <malloc.h> -
uspace/lib/c/generic/inet/addr.c
rc8fbbe7 r810a36f 41 41 #include <malloc.h> 42 42 #include <bitops.h> 43 #include <inttypes.h> 43 44 44 45 #define INET_PREFIXSTRSIZE 5 -
uspace/lib/c/generic/io/printf_core.c
rc8fbbe7 r810a36f 46 46 #include <assert.h> 47 47 #include <macros.h> 48 #include <wchar.h> 48 49 49 50 … … 114 115 PrintfQualifierLongLong, 115 116 PrintfQualifierPointer, 116 PrintfQualifierSize 117 PrintfQualifierSize, 118 PrintfQualifierMax 117 119 } qualifier_t; 118 120 … … 1484 1486 uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 1485 1487 break; 1488 case 'j': 1489 qualifier = PrintfQualifierMax; 1490 i = nxt; 1491 uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 1492 break; 1486 1493 default: 1487 1494 /* Default type */ … … 1629 1636 number = (uint64_t) va_arg(ap, size_t); 1630 1637 break; 1638 case PrintfQualifierMax: 1639 size = sizeof(uintmax_t); 1640 number = (uint64_t) va_arg(ap, uintmax_t); 1641 break; 1631 1642 default: 1632 1643 /* Unknown qualifier */ -
uspace/lib/c/generic/str.c
rc8fbbe7 r810a36f 46 46 #include <align.h> 47 47 #include <mem.h> 48 #include <limits.h> 48 49 49 50 /** Check the condition if wchar_t is signed */ 50 #ifdef WCHAR_IS_UNSIGNED51 #ifdef __WCHAR_UNSIGNED__ 51 52 #define WCHAR_SIGNED_CHECK(cond) (true) 52 53 #else -
uspace/lib/c/include/inttypes.h
rc8fbbe7 r810a36f 36 36 #define LIBC_INTTYPES_H_ 37 37 38 #include < libarch/inttypes.h>38 #include <_bits/inttypes.h> 39 39 40 40 #endif -
uspace/lib/c/include/io/charfield.h
rc8fbbe7 r810a36f 38 38 39 39 #include <stdbool.h> 40 #include <wchar.h> 40 41 #include <io/color.h> 41 42 #include <io/style.h> -
uspace/lib/c/include/limits.h
rc8fbbe7 r810a36f 36 36 #define LIBC_LIMITS_H_ 37 37 38 /* XXX Make this more accurate */ 39 #include <stdint.h> 40 #include <libarch/stdint.h> 38 #include <_bits/limits.h> 41 39 42 40 #endif -
uspace/lib/c/include/stddef.h
rc8fbbe7 r810a36f 36 36 #define LIBC_STDDEF_H_ 37 37 38 #include <libarch/stddef.h> 38 #include <_bits/size_t.h> 39 #include <_bits/ptrdiff_t.h> 40 #include <_bits/wchar_t.h> 39 41 40 #ifndef NULL 41 #define NULL ((void *) 0) 42 #endif 42 #include <_bits/NULL.h> 43 43 44 44 #define offsetof(type, member) \ -
uspace/lib/c/include/stdint.h
rc8fbbe7 r810a36f 36 36 #define LIBC_STDINT_H_ 37 37 38 #define INT8_MIN INT8_C(0x80) 39 #define INT8_MAX INT8_C(0x7F) 40 41 #define UINT8_MIN UINT8_C(0) 42 #define UINT8_MAX UINT8_C(0xFF) 43 44 #define INT16_MIN INT16_C(0x8000) 45 #define INT16_MAX INT16_C(0x7FFF) 46 47 #define UINT16_MIN UINT16_C(0) 48 #define UINT16_MAX UINT16_C(0xFFFF) 49 50 #define INT32_MIN INT32_C(0x80000000) 51 #define INT32_MAX INT32_C(0x7FFFFFFF) 52 53 #define UINT32_MIN UINT32_C(0) 54 #define UINT32_MAX UINT32_C(0xFFFFFFFF) 55 56 #define INT64_MIN INT64_C(0x8000000000000000) 57 #define INT64_MAX INT64_C(0x7FFFFFFFFFFFFFFF) 58 59 #define UINT64_MIN UINT64_C(0) 60 #define UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF) 61 62 #include <libarch/stdint.h> 38 #include <_bits/stdint.h> 63 39 64 40 #endif -
uspace/lib/c/include/types/common.h
rc8fbbe7 r810a36f 36 36 #define LIBC_TYPES_COMMON_H_ 37 37 38 #include <libarch/types.h> 38 #if __SIZEOF_POINTER__ == 4 39 #define __32_BITS__ 40 #elif __SIZEOF_POINTER__ == 8 41 #define __64_BITS__ 42 #else 43 #error __SIZEOF_POINTER__ is not defined. 44 #endif 45 46 #include <_bits/all.h> 39 47 40 48 #endif -
uspace/lib/draw/gfx/font-8x16.h
rc8fbbe7 r810a36f 38 38 #include <stdint.h> 39 39 #include <stdbool.h> 40 #include <stddef.h> 40 41 41 42 #define FONT_GLYPHS 2899 -
uspace/lib/drv/generic/logbuf.c
rc8fbbe7 r810a36f 31 31 */ 32 32 33 #include <libarch/common.h>34 33 #include <stdio.h> 35 34 #include <stddef.h> -
uspace/lib/drv/include/ddf/interrupt.h
rc8fbbe7 r810a36f 36 36 #define DDF_INTERRUPT_H_ 37 37 38 #include <libarch/common.h>39 38 #include <types/common.h> 40 39 #include <abi/ddi/irq.h> -
uspace/lib/http/include/http/receive-buffer.h
rc8fbbe7 r810a36f 39 39 #include <adt/list.h> 40 40 #include <stddef.h> 41 #include <types/common.h> 41 42 42 43 /** Receive data. -
uspace/lib/math/include/mathtypes.h
rc8fbbe7 r810a36f 191 191 #endif 192 192 193 194 #if defined(FLOAT_SIZE_32) 195 196 #ifndef float32_t 197 #define float32_t float 198 #endif 199 200 #elif defined(FLOAT_SIZE_64) 201 202 #ifndef float64_t 203 #define float64_t float 204 #endif 205 206 #elif defined(FLOAT_SIZE_96) 207 208 #ifndef float96_t 209 #define float96_t float 210 #endif 211 212 #elif defined(FLOAT_SIZE_128) 213 214 #ifndef float128_t 215 #define float128_t float 216 #endif 217 218 #endif 219 220 221 #if defined(DOUBLE_SIZE_32) 222 223 #ifndef float32_t 224 #define float32_t double 225 #endif 226 227 #elif defined(DOUBLE_SIZE_64) 228 229 #ifndef float64_t 230 #define float64_t double 231 #endif 232 233 #elif defined(DOUBLE_SIZE_96) 234 235 #ifndef float96_t 236 #define float96_t double 237 #endif 238 239 #elif defined(DOUBLE_SIZE_128) 240 241 #ifndef float128_t 242 #define float128_t double 243 #endif 244 245 #endif 246 247 248 #if defined(LONG_DOUBLE_SIZE_32) 249 250 #ifndef float32_t 251 #define float32_t long double 252 #endif 253 254 #elif defined(LONG_DOUBLE_SIZE_64) 255 256 #ifndef float64_t 257 #define float64_t long double 258 #endif 259 260 #elif defined(LONG_DOUBLE_SIZE_96) 261 262 #ifndef float96_t 263 #define float96_t long double 264 #endif 265 266 #elif defined(LONG_DOUBLE_SIZE_128) 267 268 #ifndef float128_t 269 #define float128_t long double 270 #endif 271 272 #endif 273 193 #if __SIZEOF_FLOAT__ == 4 194 #define float32_t float 195 #elif __SIZEOF_DOUBLE__ == 4 196 #define float32_t double 197 #elif __SIZEOF_LONG_DOUBLE__ == 4 198 #define float32_t long double 199 #endif 200 201 #if __SIZEOF_FLOAT__ == 8 202 #define float64_t float 203 #elif __SIZEOF_DOUBLE__ == 8 204 #define float64_t double 205 #elif __SIZEOF_LONG_DOUBLE__ == 8 206 #define float64_t long double 207 #endif 208 209 #if __SIZEOF_FLOAT__ == 12 210 #define float96_t float 211 #elif __SIZEOF_DOUBLE__ == 12 212 #define float96_t double 213 #elif __SIZEOF_LONG_DOUBLE__ == 12 214 #define float96_t long double 215 #endif 216 217 #if __SIZEOF_FLOAT__ == 16 218 #define float128_t float 219 #elif __SIZEOF_DOUBLE__ == 16 220 #define float128_t double 221 #elif __SIZEOF_LONG_DOUBLE__ == 16 222 #define float128_t long double 223 #endif 274 224 275 225 #ifdef float32_t -
uspace/lib/nic/include/nic_addr_db.h
rc8fbbe7 r810a36f 44 44 45 45 #include <adt/hash_table.h> 46 #include <types/common.h> 46 47 47 48 /** -
uspace/lib/nic/src/nic_addr_db.c
rc8fbbe7 r810a36f 36 36 */ 37 37 #include "nic_addr_db.h" 38 #include "libarch/common.h"39 38 #include <assert.h> 40 39 #include <stdlib.h> -
uspace/lib/posix/include/posix/limits.h
rc8fbbe7 r810a36f 42 42 #define PATH_MAX 256 43 43 44 /* it's probably a safe assumption */45 #undef CHAR_BIT46 #define CHAR_BIT 847 48 44 #endif /* POSIX_LIMITS_H_ */ 49 45 -
uspace/lib/posix/include/posix/locale.h
rc8fbbe7 r810a36f 40 40 #endif 41 41 42 #ifndef NULL 43 #define NULL ((void *) 0) 44 #endif 42 #include <_bits/NULL.h> 45 43 46 44 #ifndef __locale_t_defined -
uspace/lib/posix/include/posix/stddef.h
rc8fbbe7 r810a36f 42 42 #include "sys/types.h" 43 43 44 #ifndef NULL 45 #define NULL ((void *) 0) 46 #endif 44 #include <_bits/NULL.h> 47 45 48 46 #define offsetof(type,member) ((size_t) &(((type *) 0)->member)) -
uspace/lib/posix/include/posix/stdint.h
rc8fbbe7 r810a36f 42 42 #include "libc/stdint.h" 43 43 44 #undef INT8_MAX45 #undef INT8_MIN46 #define INT8_MAX 12747 #define INT8_MIN (-128)48 49 #undef UINT8_MAX50 #undef UINT8_MIN51 #define UINT8_MAX 25552 #define UINT8_MIN 053 54 #undef INT16_MAX55 #undef INT16_MIN56 #define INT16_MAX 3276757 #define INT16_MIN (-32768)58 59 #undef UINT16_MAX60 #undef UINT16_MIN61 #define UINT16_MAX 6553562 #define UINT16_MIN 063 64 #undef INT32_MAX65 #undef INT32_MIN66 #define INT32_MAX 214748364767 #define INT32_MIN (-INT32_MAX - 1)68 69 #undef UINT32_MAX70 #undef UINT32_MIN71 #define UINT32_MAX 4294967295U72 #define UINT32_MIN 0U73 74 #undef INT64_MAX75 #undef INT64_MIN76 #define INT64_MAX 9223372036854775807LL77 #define INT64_MIN (-INT64_MAX - 1LL)78 79 #undef UINT64_MAX80 #undef UINT64_MIN81 #define UINT64_MAX 18446744073709551615ULL82 #define UINT64_MIN 0ULL83 84 44 #undef OFF64_MAX 85 45 #undef OFF64_MIN … … 92 52 #define AOFF64_MIN UINT64_MIN 93 53 94 #undef INTMAX_MIN95 #undef INTMAX_MAX96 #define INTMAX_MIN INT64_MIN97 #define INTMAX_MAX INT64_MAX98 99 #undef UINTMAX_MIN100 #undef UINTMAX_MAX101 #define UINTMAX_MIN UINT64_MIN102 #define UINTMAX_MAX UINT64_MAX103 104 /*105 * Fast* and least* integer types.106 *107 * The definitions below are correct as long as uint8/16/32/64_t are defined.108 * Considering the entire rest of the system would break down if they were not,109 * these definitions are just fine.110 */111 typedef uint8_t uint_least8_t;112 typedef uint16_t uint_least16_t;113 typedef uint32_t uint_least32_t;114 typedef uint64_t uint_least64_t;115 116 typedef int8_t int_least8_t;117 typedef int16_t int_least16_t;118 typedef int32_t int_least32_t;119 typedef int64_t int_least64_t;120 121 typedef uint8_t uint_fast8_t;122 typedef uint16_t uint_fast16_t;123 typedef uint32_t uint_fast32_t;124 typedef uint64_t uint_fast64_t;125 126 typedef int8_t int_fast8_t;127 typedef int16_t int_fast16_t;128 typedef int32_t int_fast32_t;129 typedef int64_t int_fast64_t;130 131 54 #endif /* POSIX_STDINT_H_ */ 132 55 -
uspace/lib/posix/include/posix/stdlib.h
rc8fbbe7 r810a36f 43 43 #include "sys/types.h" 44 44 45 #ifndef NULL 46 #define NULL ((void *) 0) 47 #endif 45 #include <_bits/NULL.h> 48 46 49 47 #define RAND_MAX 714025 -
uspace/lib/posix/include/posix/string.h
rc8fbbe7 r810a36f 51 51 */ 52 52 53 #ifndef NULL 54 #define NULL ((void *) 0) 55 #endif 53 #include <_bits/NULL.h> 56 54 57 55 /* -
uspace/lib/posix/include/posix/time.h
rc8fbbe7 r810a36f 43 43 #include "sys/types.h" 44 44 45 #ifndef NULL 46 #define NULL ((void *) 0) 47 #endif 45 #include <_bits/NULL.h> 48 46 49 47 #ifndef CLOCKS_PER_SEC -
uspace/lib/trackmod/xm.c
rc8fbbe7 r810a36f 38 38 #include <stdlib.h> 39 39 #include <mem.h> 40 #include <types/common.h> 40 41 41 42 #include "byteorder.h"
Note:
See TracChangeset
for help on using the changeset viewer.