diff options
author | chandramouli narayanan <mouli@linux.intel.com> | 2012-06-25 12:32:17 -0700 |
---|---|---|
committer | chandramouli narayanan <mouli@linux.intel.com> | 2012-06-25 12:32:17 -0700 |
commit | c53187e1adc326c3246917cb936cbab020b4d820 (patch) | |
tree | cf7a94ca5438c1fafbd28b05b04f0264e452638a /com32/include/bitsize64 | |
parent | 937f816addb214ca4c8c1ce977e0357eafa8c617 (diff) | |
download | syslinux-c53187e1adc326c3246917cb936cbab020b4d820.tar.gz |
Patches here support 32bit and 64bit environment.
Move the standard definitions of constants, variously-sized ints,limits into
respective architecture specific files. com32/include/bitsize holds the standard
header files that in turn include bitsize32 or bitsize64 based on the architecture.
The makefiles should build pick the right ones based on architecture.
Files com32/include/sys/cpu.h, com32/include/sys/bitops.h now have
architecture specific files underneath to define relevant macros definitions.
com32/include/setjmp.h has architecture specific counterparts underneath.
ssize_t in dos/stdlib.h is appropriately defined based on architecture to be able
to support building for 32bit and 64bit environments.
Remanants of the unused old i386-only files, if any, need to be pruned.
Diffstat (limited to 'com32/include/bitsize64')
-rw-r--r-- | com32/include/bitsize64/limits.h | 14 | ||||
-rw-r--r-- | com32/include/bitsize64/stddef.h | 10 | ||||
-rw-r--r-- | com32/include/bitsize64/stdint.h | 41 | ||||
-rw-r--r-- | com32/include/bitsize64/stdintconst.h | 13 | ||||
-rw-r--r-- | com32/include/bitsize64/stdintlimits.h | 23 |
5 files changed, 101 insertions, 0 deletions
diff --git a/com32/include/bitsize64/limits.h b/com32/include/bitsize64/limits.h new file mode 100644 index 00000000..f5bbf830 --- /dev/null +++ b/com32/include/bitsize64/limits.h @@ -0,0 +1,14 @@ +/* + * bits64/limits.h + */ + +#ifndef _BITSIZE_LIMITS_H +#define _BITSIZE_LIMITS_H + +#define LONG_BIT 64 + +#define LONG_MIN (-9223372036854775807L-1) +#define LONG_MAX 9223372036854775807L +#define ULONG_MAX 18446744073709551615UL + +#endif /* _BITSIZE_LIMITS_H */ diff --git a/com32/include/bitsize64/stddef.h b/com32/include/bitsize64/stddef.h new file mode 100644 index 00000000..057a721f --- /dev/null +++ b/com32/include/bitsize64/stddef.h @@ -0,0 +1,10 @@ +/* + * bits64/stddef.h + */ + + +#define _SIZE_T +typedef unsigned long size_t; +#define _PTRDIFF_T +typedef signed long ptrdiff_t; + diff --git a/com32/include/bitsize64/stdint.h b/com32/include/bitsize64/stdint.h new file mode 100644 index 00000000..32de44c5 --- /dev/null +++ b/com32/include/bitsize64/stdint.h @@ -0,0 +1,41 @@ +/* + * bits64/stdint.h + */ + + +/* +typedef signed char int8_t; +typedef short int int16_t; +typedef int int32_t; +typedef long int int64_t; + +typedef unsigned char uint8_t; +typedef unsigned short int uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long int uint64_t; + +typedef long int int_fast16_t; +typedef long int int_fast32_t; + +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; + +typedef long int intptr_t; +typedef unsigned long int uintptr_t; + +#define __INT64_C(c) c ## L +#define __UINT64_C(c) c ## UL + +#define __PRI64_RANK "l" +#define __PRIFAST_RANK "l" +#define __PRIPTR_RANK "l" +*/ + +/* based on compiler output */ +typedef signed long int_fast16_t; +typedef signed long int int_fast32_t; +typedef unsigned long int uint_fast16_t; +/* Pointer types */ + +typedef long int intptr_t; +typedef long unsigned int uintptr_t; diff --git a/com32/include/bitsize64/stdintconst.h b/com32/include/bitsize64/stdintconst.h new file mode 100644 index 00000000..139ab203 --- /dev/null +++ b/com32/include/bitsize64/stdintconst.h @@ -0,0 +1,13 @@ +/* + * bits64/stdintconst.h + */ + +#define INT_FAST16_C(c) INT64_C(c) +#define INT_FAST32_C(c) INT64_C(c) + +#define UINT_FAST16_C(c) UINT64_C(c) +#define UINT_FAST32_C(c) UINT64_C(c) + +#define INTPTR_C(c) INT64_C(c) +#define UINTPTR_C(c) UINT64_C(c) +#define PTRDIFF_C(c) INT64_C(c) diff --git a/com32/include/bitsize64/stdintlimits.h b/com32/include/bitsize64/stdintlimits.h new file mode 100644 index 00000000..a775a7fd --- /dev/null +++ b/com32/include/bitsize64/stdintlimits.h @@ -0,0 +1,23 @@ +/* + * bits64/stdintlimits.h + */ + +#define INT_FAST16_MIN INT64_MIN +#define INT_FAST32_MIN INT64_MIN +#define INT_FAST16_MAX INT64_MAX +#define INT_FAST32_MAX INT64_MAX +#define UINT_FAST16_MAX UINT64_MAX +#define UINT_FAST32_MAX UINT64_MAX + +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX + +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX + +/* sig_atomic_t limit */ +# define SIG_ATOMIC_MAX INT32_MAX //(2147483647) +# define SIG_ATOMIC_MIN (-SIG_ATOMIC_MAX-1) //(-2147483647-1) +/* size_t limit */ +# define SIZE_MAX UINT64_MAX |