xref: /openbmc/linux/arch/mips/lib/libgcc.h (revision ebabcf17)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
272fbfb26SRalf Baechle #ifndef __ASM_LIBGCC_H
372fbfb26SRalf Baechle #define __ASM_LIBGCC_H
472fbfb26SRalf Baechle 
572fbfb26SRalf Baechle #include <asm/byteorder.h>
672fbfb26SRalf Baechle 
772fbfb26SRalf Baechle typedef int word_type __attribute__ ((mode (__word__)));
872fbfb26SRalf Baechle 
972fbfb26SRalf Baechle #ifdef __BIG_ENDIAN
1072fbfb26SRalf Baechle struct DWstruct {
1172fbfb26SRalf Baechle 	int high, low;
1272fbfb26SRalf Baechle };
13ebabcf17SJames Hogan 
14ebabcf17SJames Hogan struct TWstruct {
15ebabcf17SJames Hogan 	long long high, low;
16ebabcf17SJames Hogan };
1772fbfb26SRalf Baechle #elif defined(__LITTLE_ENDIAN)
1872fbfb26SRalf Baechle struct DWstruct {
1972fbfb26SRalf Baechle 	int low, high;
2072fbfb26SRalf Baechle };
21ebabcf17SJames Hogan 
22ebabcf17SJames Hogan struct TWstruct {
23ebabcf17SJames Hogan 	long long low, high;
24ebabcf17SJames Hogan };
2572fbfb26SRalf Baechle #else
2672fbfb26SRalf Baechle #error I feel sick.
2772fbfb26SRalf Baechle #endif
2872fbfb26SRalf Baechle 
29b44c779aSAndrea Gelmini typedef union {
3072fbfb26SRalf Baechle 	struct DWstruct s;
3172fbfb26SRalf Baechle 	long long ll;
3272fbfb26SRalf Baechle } DWunion;
3372fbfb26SRalf Baechle 
34ebabcf17SJames Hogan #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6)
35ebabcf17SJames Hogan typedef int ti_type __attribute__((mode(TI)));
36ebabcf17SJames Hogan 
37ebabcf17SJames Hogan typedef union {
38ebabcf17SJames Hogan 	struct TWstruct s;
39ebabcf17SJames Hogan 	ti_type ti;
40ebabcf17SJames Hogan } TWunion;
41ebabcf17SJames Hogan #endif
42ebabcf17SJames Hogan 
4372fbfb26SRalf Baechle #endif /* __ASM_LIBGCC_H */
44