tty/serial: lay the foundations for the next set of reworks
[linux-2.6/kvm.git] / include / asm-powerpc / types.h
blobc243a6ac60e528506b9c4fc48bea7f6146d818b5
1 #ifndef _ASM_POWERPC_TYPES_H
2 #define _ASM_POWERPC_TYPES_H
4 #ifndef __ASSEMBLY__
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.
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.
19 #ifdef __powerpc64__
20 typedef unsigned int umode_t;
21 #else
22 typedef unsigned short umode_t;
23 #endif
26 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
27 * header files exported to user space
30 typedef __signed__ char __s8;
31 typedef unsigned char __u8;
33 typedef __signed__ short __s16;
34 typedef unsigned short __u16;
36 typedef __signed__ int __s32;
37 typedef unsigned int __u32;
39 #ifdef __powerpc64__
40 typedef __signed__ long __s64;
41 typedef unsigned long __u64;
42 #else
43 #if defined(__GNUC__)
44 __extension__ typedef __signed__ long long __s64;
45 __extension__ typedef unsigned long long __u64;
46 #endif
47 #endif /* __powerpc64__ */
49 typedef struct {
50 __u32 u[4];
51 } __attribute__((aligned(16))) __vector128;
53 #endif /* __ASSEMBLY__ */
55 #ifdef __KERNEL__
57 * These aren't exported outside the kernel to avoid name space clashes
59 #ifdef __powerpc64__
60 #define BITS_PER_LONG 64
61 #else
62 #define BITS_PER_LONG 32
63 #endif
65 #ifndef __ASSEMBLY__
68 typedef signed char s8;
69 typedef unsigned char u8;
71 typedef signed short s16;
72 typedef unsigned short u16;
74 typedef signed int s32;
75 typedef unsigned int u32;
77 #ifdef __powerpc64__
78 typedef signed long s64;
79 typedef unsigned long u64;
80 #else
81 typedef signed long long s64;
82 typedef unsigned long long u64;
83 #endif
85 typedef __vector128 vector128;
87 /* Physical address used by some IO functions */
88 #if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
89 typedef u64 phys_addr_t;
90 #else
91 typedef u32 phys_addr_t;
92 #endif
94 #ifdef __powerpc64__
95 typedef u64 dma_addr_t;
96 #else
97 typedef u32 dma_addr_t;
98 #endif
99 typedef u64 dma64_addr_t;
101 typedef struct {
102 unsigned long entry;
103 unsigned long toc;
104 unsigned long env;
105 } func_descr_t;
107 #endif /* __ASSEMBLY__ */
109 #endif /* __KERNEL__ */
111 #endif /* _ASM_POWERPC_TYPES_H */