xref: /openbmc/linux/arch/mips/lib/libgcc.h (revision 664b0bae0b87f69bc9deb098f5e0158b9cf18e04)
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 };
13*ebabcf17SJames Hogan 
14*ebabcf17SJames Hogan struct TWstruct {
15*ebabcf17SJames Hogan 	long long high, low;
16*ebabcf17SJames Hogan };
1772fbfb26SRalf Baechle #elif defined(__LITTLE_ENDIAN)
1872fbfb26SRalf Baechle struct DWstruct {
1972fbfb26SRalf Baechle 	int low, high;
2072fbfb26SRalf Baechle };
21*ebabcf17SJames Hogan 
22*ebabcf17SJames Hogan struct TWstruct {
23*ebabcf17SJames Hogan 	long long low, high;
24*ebabcf17SJames 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 
34*ebabcf17SJames Hogan #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6)
35*ebabcf17SJames Hogan typedef int ti_type __attribute__((mode(TI)));
36*ebabcf17SJames Hogan 
37*ebabcf17SJames Hogan typedef union {
38*ebabcf17SJames Hogan 	struct TWstruct s;
39*ebabcf17SJames Hogan 	ti_type ti;
40*ebabcf17SJames Hogan } TWunion;
41*ebabcf17SJames Hogan #endif
42*ebabcf17SJames Hogan 
4372fbfb26SRalf Baechle #endif /* __ASM_LIBGCC_H */
44