blob: ec3c2ee8bf86e7a52e59e6531904b881cfce4801 [file] [log] [blame]
Becky Bruce971dc772005-10-19 18:45:03 -05001#ifndef _ASM_POWERPC_TYPES_H
2#define _ASM_POWERPC_TYPES_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
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 Bruce971dc772005-10-19 18:45:03 -050019#ifdef __powerpc64__
Linus Torvalds1da177e2005-04-16 15:20:36 -070020typedef unsigned int umode_t;
Becky Bruce971dc772005-10-19 18:45:03 -050021#else
22typedef unsigned short umode_t;
23#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
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
30typedef __signed__ char __s8;
31typedef unsigned char __u8;
32
33typedef __signed__ short __s16;
34typedef unsigned short __u16;
35
36typedef __signed__ int __s32;
37typedef unsigned int __u32;
38
Becky Bruce971dc772005-10-19 18:45:03 -050039#ifdef __powerpc64__
Linus Torvalds1da177e2005-04-16 15:20:36 -070040typedef __signed__ long __s64;
41typedef unsigned long __u64;
Becky Bruce971dc772005-10-19 18:45:03 -050042#else
43#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
44typedef __signed__ long long __s64;
45typedef unsigned long long __u64;
46#endif
47#endif /* __powerpc64__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49typedef 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 Bruce971dc772005-10-19 18:45:03 -050059#ifdef __powerpc64__
Linus Torvalds1da177e2005-04-16 15:20:36 -070060#define BITS_PER_LONG 64
Becky Bruce971dc772005-10-19 18:45:03 -050061#else
62#define BITS_PER_LONG 32
63#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
65#ifndef __ASSEMBLY__
66
Becky Brucebfbac492005-10-21 16:16:58 -050067#include <linux/config.h>
68
Linus Torvalds1da177e2005-04-16 15:20:36 -070069typedef signed char s8;
70typedef unsigned char u8;
71
72typedef signed short s16;
73typedef unsigned short u16;
74
75typedef signed int s32;
76typedef unsigned int u32;
77
Becky Bruce971dc772005-10-19 18:45:03 -050078#ifdef __powerpc64__
Linus Torvalds1da177e2005-04-16 15:20:36 -070079typedef signed long s64;
80typedef unsigned long u64;
Becky Bruce971dc772005-10-19 18:45:03 -050081#else
82typedef signed long long s64;
83typedef unsigned long long u64;
84#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
86typedef __vector128 vector128;
87
Stephen Rothwell8168f902005-10-25 16:56:43 +100088#ifdef __powerpc64__
89typedef u64 dma_addr_t;
90#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070091typedef u32 dma_addr_t;
Stephen Rothwell8168f902005-10-25 16:56:43 +100092#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070093typedef u64 dma64_addr_t;
94
95typedef struct {
96 unsigned long entry;
97 unsigned long toc;
98 unsigned long env;
99} func_descr_t;
100
Becky Bruce971dc772005-10-19 18:45:03 -0500101#ifdef CONFIG_LBD
102typedef u64 sector_t;
103#define HAVE_SECTOR_T
104#endif
105
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106#endif /* __ASSEMBLY__ */
107
108#endif /* __KERNEL__ */
109
Becky Bruce971dc772005-10-19 18:45:03 -0500110#endif /* _ASM_POWERPC_TYPES_H */