]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/sandbox/include/asm/types.h
sandbox: Add 64-bit sandbox
[people/ms/u-boot.git] / arch / sandbox / include / asm / types.h
CommitLineData
744d9859
SG
1/*
2 * Copyright (c) 2011 The Chromium OS Authors.
3 *
3765b3e7 4 * SPDX-License-Identifier: GPL-2.0+
744d9859
SG
5 */
6
7#ifndef __ASM_SANDBOX_TYPES_H
8#define __ASM_SANDBOX_TYPES_H
9
10typedef unsigned short umode_t;
11
12/*
13 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
14 * header files exported to user space
15 */
16
17typedef __signed__ char __s8;
18typedef unsigned char __u8;
19
20typedef __signed__ short __s16;
21typedef unsigned short __u16;
22
23typedef __signed__ int __s32;
24typedef unsigned int __u32;
25
26#if defined(__GNUC__)
27__extension__ typedef __signed__ long long __s64;
28__extension__ typedef unsigned long long __u64;
29#endif
30
31/*
32 * These aren't exported outside the kernel to avoid name space clashes
33 */
34#ifdef __KERNEL__
35
36typedef signed char s8;
37typedef unsigned char u8;
38
39typedef signed short s16;
40typedef unsigned short u16;
41
42typedef signed int s32;
43typedef unsigned int u32;
44
0d296cc2 45#if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__)
744d9859
SG
46typedef signed long long s64;
47typedef unsigned long long u64;
0d296cc2
GB
48#else
49typedef __INT64_TYPE__ s64;
50typedef __UINT64_TYPE__ u64;
51#endif
744d9859 52
6823e6fe 53/*
c6b89f31 54 * Number of bits in a C 'long' on this architecture.
6823e6fe 55 */
c6b89f31
MS
56#ifdef CONFIG_PHYS64
57#define BITS_PER_LONG 64
58#else /* CONFIG_PHYS64 */
59#define BITS_PER_LONG 32
60#endif /* CONFIG_PHYS64 */
61
62#ifdef CONFIG_PHYS64
63typedef unsigned long long dma_addr_t;
64typedef u64 phys_addr_t;
65typedef u64 phys_size_t;
66#else /* CONFIG_PHYS64 */
744d9859 67typedef unsigned long dma_addr_t;
0eb2acee
SG
68typedef u32 phys_addr_t;
69typedef u32 phys_size_t;
c6b89f31 70#endif /* CONFIG_PHYS64 */
744d9859
SG
71
72#endif /* __KERNEL__ */
73
74#endif