aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/machine.h
AgeCommit message (Collapse)AuthorFilesLines
2020-07-13Merge branches 'march', 'endianness', 'os' and 'arch-mini' into archLuc Van Oostenryck1-0/+6
2020-07-13openrisc: add minimal supportLuc Van Oostenryck1-0/+1
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-07-13sh: add minimal supportLuc Van Oostenryck1-0/+1
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-07-13nds32: add minimal supportLuc Van Oostenryck1-0/+1
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-07-13xtensa: add minimal supportLuc Van Oostenryck1-0/+1
This is one of the architecture needing a specific predefine set in order to correctly process byteorder.h. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-07-13h8300: add minimal supportLuc Van Oostenryck1-0/+1
This is now the only architecture needing '-msize-long'. Prepare the obsolescence of this option by adding the target file for this architecture. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-07-13arch: add an option to specify the OS: --os=$OSLuc Van Oostenryck1-0/+1
This is not needed when doing native 'compilation' but is quite handy when testing the predefined types & macros. The supported OSes are: 'linux', 'freebsd', 'openbsd', 'netbsd' 'darwin', 'sunos', 'cygwin' and a generic 'unix'. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-07-06arch: add minimal support for microblazeLuc Van Oostenryck1-0/+1
The Kernel Test Robot reports a problem on microblaze. The cause is that __MICROBLAZEEL__ is not defined. However, the real problem is that sparse has no support at all for this architecture. So, add the minimal support for microblaze. Link: https://lore.kernel.org/lkml/202007060542.hNfoTcsC%25lkp@intel.com Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-06-12arch: add specificities for AlphaLuc Van Oostenryck1-0/+3
The real goal here is in fact to move the alpha-specfic builtins out of the main builtins table. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-06-12arch: add specificities for BlackfinLuc Van Oostenryck1-0/+1
The real goal here is in fact to move the bfin-specfic builtins out of the main builtins table. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-06-12arch: add specificities for Nios2Luc Van Oostenryck1-0/+1
The real goal here is, in fact, to move the nios2-specfic builtins out of the main builtins table. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-05-15misc: fix typo: s/OS_UNIX/OS_NATIVE/Luc Van Oostenryck1-1/+1
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-01-22correct sparcv9 definesToomas Soome1-1/+1
The SPARCV9 compile check needs to look for __sparcv9 on some systems, and should also define "sparc". Signed-off-by: Toomas Soome <tsoome@me.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-01-22allow to easily test if the OS is UNIX-likeLuc Van Oostenryck1-2/+2
Only on UNIX-like OSes are __unix__ & __unix predefined, so it's needed to easily test if the OS is UNIX-like or not. Let's do this cheaply by moving all the define of UNIX-like OSes after the define for 'generic UNIX': OS_UNIX. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-01-22detect OS_UNIX as native OSLuc Van Oostenryck1-0/+3
If nothing more specific matches but __unix__ or __unix is defined, use OS_UNIX as the native OS. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-01-22detect native OS on OpenBSD & NetBSDLuc Van Oostenryck1-0/+4
Sparse knew about OpenBSD & NetBSD but didn't detected them. Until now, that's it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-01-22detect native OS in alphabetical orderLuc Van Oostenryck1-6/+6
The detection of the native OS was done in a strange order. Now, do this alphabetically. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-01-22fix typo when detecting SunOSLuc Van Oostenryck1-1/+1
When detecting SunOS, '&&' was used instead of '||'. Fix that. Fixes: 6bca188679d235ddbad2e97aa3e4186a4730686e Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2019-12-16arch: move arch-specificities to their own filesLuc Van Oostenryck1-1/+1
lib.c and even more so, target.c, become cluttered by the arch specific type initialization. It would be better to move this to arch-specific files, move the generics target related helpers to target.c and have sparse_initialize() to just call these helpers. For doing this: * introduce a struct to hold the configurations for each arch, * move the arch-specific type initialization to separate files, * make target.c generic. Also change the default types to LP64. Note: this is the first step to better handle other arch specificities like the predefines or the handling of some options. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2019-11-28Merge branch 'arch-cleanup' into masterLuc Van Oostenryck1-0/+26
2019-11-28arch: use a variable for the OSLuc Van Oostenryck1-0/+26
There are a few OS-specific settings and handling them with #ifdef is 1) ugly, 2) can only work with when specifically built for this OS (either a native or cross-build). So, use a variable to hold the OS and initialize it to the one used to compile sparse. This avoid the ugly #ifdef and allow simpler transition if if the future sparse would take the OS in parameter (maybe as triple). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2019-11-27Merge branch 'arm-hf' into masterLuc Van Oostenryck1-0/+15
2019-11-27fp-abi: teach sparse about -mfloat-abi on ARMLuc Van Oostenryck1-0/+15
Teach sparse about the -mfloat-abi option and set the related predefines for ARM accordingly. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2019-11-14arch: fix the signedness of plain charsLuc Van Oostenryck1-6/+0
Some architectures, like ARM or PPC, use 'unsigned' for plain chars while others, like the Intel's, use signed ones. Sparse understands -funsigned-char but by default uses the native signedness. Fix this by setting the proper signedness of plain chars for the archs that Sparse know about. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2019-10-30arch: add support for s390 (ILP32)Luc Van Oostenryck1-1/+3
On s390x, the flag -m31 is needed to enable this mode. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2019-10-30arch: reorder MACH_XXX definesLuc Van Oostenryck1-12/+6
Some architectures have a 32- and a 64-bit variant which can be exchanged via the -m32/-m64 flags. Make clear the correspondance between these variant when defining the MACH_XXX. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2019-02-01machine.h: Fix MACH_NATIVE on m68kUwe Kleine-König1-1/+1
This fixes a failure to compile on m68k as MACH_68K is undefined. Fixes: ce50c885b8b0 ("add detection of native platform") Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-12-17add predefine for __CHAR_UNSIGNED__Luc Van Oostenryck1-0/+6
This macro is needed by <limits.h> to get, among others things, CHAR_MAX from __SCHAR_MAX__. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-12-14test endianness with __BYTE_ORDER__Luc Van Oostenryck1-1/+1
The detection of the native endianness is currently done by testing if __BIG_ENDIAN__ is defined. However, not all native big endian platforms define this macro. Test the endianness with __BYTE_ORDER__. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-12-14Consolidate 'machine detection' into "machine.h"Luc Van Oostenryck1-0/+23
The file "lib.c' contains some defines and have some #ifdefery to detect the data model of the native machine (LP32/LP64). Same for the native endianness. Move these into "machine.h" where the platform detection is already done. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-12-14add detection of native platformLuc Van Oostenryck1-0/+54
The underlying type of most builtin types (size_t, int32_t, ...), as well as their size, the endianness and other parameters are platform dependent. The minimal is to have these parameters correct on the native machine. Use the diffrent predefined macros to detect the native machine. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>