Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 1 | #ifndef _ASM_POWERPC_TYPES_H |
| 2 | #define _ASM_POWERPC_TYPES_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
| 4 | #ifndef __ASSEMBLY__ |
| 5 | |
| 6 | /* |
| 7 | * This file is never included by application software unless |
| 8 | * explicitly requested (e.g., via linux/types.h) in which case the |
| 9 | * application is Linux specific so (user-) name space pollution is |
| 10 | * not a major issue. However, for interoperability, libraries still |
| 11 | * need to be careful to avoid a name clashes. |
| 12 | * |
| 13 | * This program is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU General Public License |
| 15 | * as published by the Free Software Foundation; either version |
| 16 | * 2 of the License, or (at your option) any later version. |
| 17 | */ |
| 18 | |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 19 | #ifdef __powerpc64__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | typedef unsigned int umode_t; |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 21 | #else |
| 22 | typedef unsigned short umode_t; |
| 23 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
| 25 | /* |
| 26 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the |
| 27 | * header files exported to user space |
| 28 | */ |
| 29 | |
| 30 | typedef __signed__ char __s8; |
| 31 | typedef unsigned char __u8; |
| 32 | |
| 33 | typedef __signed__ short __s16; |
| 34 | typedef unsigned short __u16; |
| 35 | |
| 36 | typedef __signed__ int __s32; |
| 37 | typedef unsigned int __u32; |
| 38 | |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 39 | #ifdef __powerpc64__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | typedef __signed__ long __s64; |
| 41 | typedef unsigned long __u64; |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 42 | #else |
| 43 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) |
| 44 | typedef __signed__ long long __s64; |
| 45 | typedef unsigned long long __u64; |
| 46 | #endif |
| 47 | #endif /* __powerpc64__ */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
| 49 | typedef struct { |
| 50 | __u32 u[4]; |
| 51 | } __attribute((aligned(16))) __vector128; |
| 52 | |
| 53 | #endif /* __ASSEMBLY__ */ |
| 54 | |
| 55 | #ifdef __KERNEL__ |
| 56 | /* |
| 57 | * These aren't exported outside the kernel to avoid name space clashes |
| 58 | */ |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 59 | #ifdef __powerpc64__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | #define BITS_PER_LONG 64 |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 61 | #else |
| 62 | #define BITS_PER_LONG 32 |
| 63 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
| 65 | #ifndef __ASSEMBLY__ |
| 66 | |
Becky Bruce | bfbac49 | 2005-10-21 16:16:58 -0500 | [diff] [blame] | 67 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | typedef signed char s8; |
| 69 | typedef unsigned char u8; |
| 70 | |
| 71 | typedef signed short s16; |
| 72 | typedef unsigned short u16; |
| 73 | |
| 74 | typedef signed int s32; |
| 75 | typedef unsigned int u32; |
| 76 | |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 77 | #ifdef __powerpc64__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | typedef signed long s64; |
| 79 | typedef unsigned long u64; |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 80 | #else |
| 81 | typedef signed long long s64; |
| 82 | typedef unsigned long long u64; |
| 83 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | |
| 85 | typedef __vector128 vector128; |
| 86 | |
Stephen Rothwell | 8168f90 | 2005-10-25 16:56:43 +1000 | [diff] [blame] | 87 | #ifdef __powerpc64__ |
| 88 | typedef u64 dma_addr_t; |
| 89 | #else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | typedef u32 dma_addr_t; |
Stephen Rothwell | 8168f90 | 2005-10-25 16:56:43 +1000 | [diff] [blame] | 91 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | typedef u64 dma64_addr_t; |
| 93 | |
| 94 | typedef struct { |
| 95 | unsigned long entry; |
| 96 | unsigned long toc; |
| 97 | unsigned long env; |
| 98 | } func_descr_t; |
| 99 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | #endif /* __ASSEMBLY__ */ |
| 101 | |
| 102 | #endif /* __KERNEL__ */ |
| 103 | |
Becky Bruce | 971dc77 | 2005-10-19 18:45:03 -0500 | [diff] [blame] | 104 | #endif /* _ASM_POWERPC_TYPES_H */ |