Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2005-2011 by Wind River Systems, Inc. |
| 3 | * |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 4 | * SPDX-License-Identifier: MIT |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | * |
| 6 | */ |
| 7 | |
Andrew Geissler | 99467da | 2019-02-25 18:54:23 -0600 | [diff] [blame] | 8 | #pragma once |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 10 | #if defined (__bpf__) |
| 11 | #define __MHWORDSIZE 64 |
| 12 | #elif defined (__arm__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | #define __MHWORDSIZE 32 |
| 14 | #elif defined (__aarch64__) && defined ( __LP64__) |
| 15 | #define __MHWORDSIZE 64 |
| 16 | #elif defined (__aarch64__) |
| 17 | #define __MHWORDSIZE 32 |
| 18 | #else |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | #include <bits/wordsize.h> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 20 | #if defined (__WORDSIZE) |
| 21 | #define __MHWORDSIZE __WORDSIZE |
| 22 | #else |
| 23 | #error "__WORDSIZE is not defined" |
| 24 | #endif |
| 25 | #endif |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 27 | #if __MHWORDSIZE == 32 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | |
| 29 | #ifdef _MIPS_SIM |
| 30 | |
| 31 | #if _MIPS_SIM == _ABIO32 |
| 32 | #include <ENTER_HEADER_FILENAME_HERE-32.h> |
| 33 | #elif _MIPS_SIM == _ABIN32 |
| 34 | #include <ENTER_HEADER_FILENAME_HERE-n32.h> |
| 35 | #else |
| 36 | #error "Unknown _MIPS_SIM" |
| 37 | #endif |
| 38 | |
| 39 | #else /* _MIPS_SIM is not defined */ |
| 40 | #include <ENTER_HEADER_FILENAME_HERE-32.h> |
| 41 | #endif |
| 42 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 43 | #elif __MHWORDSIZE == 64 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | #include <ENTER_HEADER_FILENAME_HERE-64.h> |
| 45 | #else |
| 46 | #error "Unknown __WORDSIZE detected" |
| 47 | #endif /* matches #if __WORDSIZE == 32 */ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | |