aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/include/uapi/asm
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-02-11 09:25:33 -0500
committerVineet Gupta <vgupta@synopsys.com>2013-02-15 12:46:11 -0500
commit8c2f4a8dd0e0fc9dcaf14c768544039eddfa7375 (patch)
tree2cee072559f4686dd070fdeb930b05e2aafa8449 /arch/arc/include/uapi/asm
parentcbe056f76a386708f3807b274322f78269aee0f6 (diff)
ARC: UAPI Disintegrate arch/arc/include/asm
1. ./genfilelist.pl arch/arc/include/asm/ 2. Create arch/arc/include/uapi/asm/Kbuild as follows +# UAPI Header export list +include include/uapi/asm-generic/Kbuild.asm 3. ./disintegrate-one.pl arch/arc/include/{,uapi/}asm/<above-list> 4. Edit arch/arc/include/asm/Kbuild to remove ref to asm-generic/Kbuild.asm - To work around empty uapi/asm/setup.h added a placholder comment. - Also a manual #ifdef __ASSEMBLY__ for a late ptrace change Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/arc/include/uapi/asm')
-rw-r--r--arch/arc/include/uapi/asm/Kbuild11
-rw-r--r--arch/arc/include/uapi/asm/byteorder.h18
-rw-r--r--arch/arc/include/uapi/asm/cachectl.h28
-rw-r--r--arch/arc/include/uapi/asm/page.h39
-rw-r--r--arch/arc/include/uapi/asm/ptrace.h48
-rw-r--r--arch/arc/include/uapi/asm/setup.h6
-rw-r--r--arch/arc/include/uapi/asm/sigcontext.h22
-rw-r--r--arch/arc/include/uapi/asm/signal.h27
-rw-r--r--arch/arc/include/uapi/asm/swab.h98
-rw-r--r--arch/arc/include/uapi/asm/unistd.h34
10 files changed, 331 insertions, 0 deletions
diff --git a/arch/arc/include/uapi/asm/Kbuild b/arch/arc/include/uapi/asm/Kbuild
new file mode 100644
index 000000000000..27362446c710
--- /dev/null
+++ b/arch/arc/include/uapi/asm/Kbuild
@@ -0,0 +1,11 @@
1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm
3header-y += page.h
4header-y += setup.h
5header-y += byteorder.h
6header-y += cachectl.h
7header-y += ptrace.h
8header-y += sigcontext.h
9header-y += signal.h
10header-y += swab.h
11header-y += unistd.h
diff --git a/arch/arc/include/uapi/asm/byteorder.h b/arch/arc/include/uapi/asm/byteorder.h
new file mode 100644
index 000000000000..9da71d415c38
--- /dev/null
+++ b/arch/arc/include/uapi/asm/byteorder.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __ASM_ARC_BYTEORDER_H
10#define __ASM_ARC_BYTEORDER_H
11
12#ifdef CONFIG_CPU_BIG_ENDIAN
13#include <linux/byteorder/big_endian.h>
14#else
15#include <linux/byteorder/little_endian.h>
16#endif
17
18#endif /* ASM_ARC_BYTEORDER_H */
diff --git a/arch/arc/include/uapi/asm/cachectl.h b/arch/arc/include/uapi/asm/cachectl.h
new file mode 100644
index 000000000000..51c73f0255b3
--- /dev/null
+++ b/arch/arc/include/uapi/asm/cachectl.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __ARC_ASM_CACHECTL_H
10#define __ARC_ASM_CACHECTL_H
11
12/*
13 * ARC ABI flags defined for Android's finegrained cacheflush requirements
14 */
15#define CF_I_INV 0x0002
16#define CF_D_FLUSH 0x0010
17#define CF_D_FLUSH_INV 0x0020
18
19#define CF_DEFAULT (CF_I_INV | CF_D_FLUSH)
20
21/*
22 * Standard flags expected by cacheflush system call users
23 */
24#define ICACHE CF_I_INV
25#define DCACHE CF_D_FLUSH
26#define BCACHE (CF_I_INV | CF_D_FLUSH)
27
28#endif
diff --git a/arch/arc/include/uapi/asm/page.h b/arch/arc/include/uapi/asm/page.h
new file mode 100644
index 000000000000..e5d41e08240c
--- /dev/null
+++ b/arch/arc/include/uapi/asm/page.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _UAPI__ASM_ARC_PAGE_H
10#define _UAPI__ASM_ARC_PAGE_H
11
12/* PAGE_SHIFT determines the page size */
13#if defined(CONFIG_ARC_PAGE_SIZE_16K)
14#define PAGE_SHIFT 14
15#elif defined(CONFIG_ARC_PAGE_SIZE_4K)
16#define PAGE_SHIFT 12
17#else
18/*
19 * Default 8k
20 * done this way (instead of under CONFIG_ARC_PAGE_SIZE_8K) because adhoc
21 * user code (busybox appletlib.h) expects PAGE_SHIFT to be defined w/o
22 * using the correct uClibc header and in their build our autoconf.h is
23 * not available
24 */
25#define PAGE_SHIFT 13
26#endif
27
28#ifdef __ASSEMBLY__
29#define PAGE_SIZE (1 << PAGE_SHIFT)
30#define PAGE_OFFSET (0x80000000)
31#else
32#define PAGE_SIZE (1UL << PAGE_SHIFT) /* Default 8K */
33#define PAGE_OFFSET (0x80000000UL) /* Kernel starts at 2G onwards */
34#endif
35
36#define PAGE_MASK (~(PAGE_SIZE-1))
37
38
39#endif /* _UAPI__ASM_ARC_PAGE_H */
diff --git a/arch/arc/include/uapi/asm/ptrace.h b/arch/arc/include/uapi/asm/ptrace.h
new file mode 100644
index 000000000000..6afa4f702075
--- /dev/null
+++ b/arch/arc/include/uapi/asm/ptrace.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Amit Bhor, Sameer Dhavale: Codito Technologies 2004
9 */
10
11#ifndef _UAPI__ASM_ARC_PTRACE_H
12#define _UAPI__ASM_ARC_PTRACE_H
13
14
15#ifndef __ASSEMBLY__
16/*
17 * Userspace ABI: Register state needed by
18 * -ptrace (gdbserver)
19 * -sigcontext (SA_SIGNINFO signal frame)
20 *
21 * This is to decouple pt_regs from user-space ABI, to be able to change it
22 * w/o affecting the ABI.
23 * Although the layout (initial padding) is similar to pt_regs to have some
24 * optimizations when copying pt_regs to/from user_regs_struct.
25 *
26 * Also, sigcontext only care about the scratch regs as that is what we really
27 * save/restore for signal handling.
28*/
29struct user_regs_struct {
30
31 struct scratch {
32 long pad;
33 long bta, lp_start, lp_end, lp_count;
34 long status32, ret, blink, fp, gp;
35 long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0;
36 long sp;
37 } scratch;
38 struct callee {
39 long pad;
40 long r25, r24, r23, r22, r21, r20;
41 long r19, r18, r17, r16, r15, r14, r13;
42 } callee;
43 long efa; /* break pt addr, for break points in delay slots */
44 long stop_pc; /* give dbg stop_pc directly after checking orig_r8 */
45};
46#endif /* !__ASSEMBLY__ */
47
48#endif /* _UAPI__ASM_ARC_PTRACE_H */
diff --git a/arch/arc/include/uapi/asm/setup.h b/arch/arc/include/uapi/asm/setup.h
new file mode 100644
index 000000000000..a6d4e44938be
--- /dev/null
+++ b/arch/arc/include/uapi/asm/setup.h
@@ -0,0 +1,6 @@
1/*
2 * setup.h is part of userspace header ABI so UAPI scripts have to generate it
3 * even if there's nothing to export - causing empty <uapi/asm/setup.h>
4 * However to prevent "patch" from discarding it we add this placeholder
5 * comment
6 */
diff --git a/arch/arc/include/uapi/asm/sigcontext.h b/arch/arc/include/uapi/asm/sigcontext.h
new file mode 100644
index 000000000000..9678a11fc158
--- /dev/null
+++ b/arch/arc/include/uapi/asm/sigcontext.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _ASM_ARC_SIGCONTEXT_H
10#define _ASM_ARC_SIGCONTEXT_H
11
12#include <asm/ptrace.h>
13
14/*
15 * Signal context structure - contains all info to do with the state
16 * before the signal handler was invoked.
17 */
18struct sigcontext {
19 struct user_regs_struct regs;
20};
21
22#endif /* _ASM_ARC_SIGCONTEXT_H */
diff --git a/arch/arc/include/uapi/asm/signal.h b/arch/arc/include/uapi/asm/signal.h
new file mode 100644
index 000000000000..fad62f7f42d6
--- /dev/null
+++ b/arch/arc/include/uapi/asm/signal.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Amit Bhor, Sameer Dhavale: Codito Technologies 2004
9 */
10
11#ifndef _ASM_ARC_SIGNAL_H
12#define _ASM_ARC_SIGNAL_H
13
14/*
15 * This is much needed for ARC sigreturn optimization.
16 * This allows uClibc to piggback the addr of a sigreturn stub in sigaction,
17 * which allows sigreturn based re-entry into kernel after handling signal.
18 * W/o this kernel needs to "synthesize" the sigreturn trampoline on user
19 * mode stack which in turn forces the following:
20 * -TLB Flush (after making the stack page executable)
21 * -Cache line Flush (to make I/D Cache lines coherent)
22 */
23#define SA_RESTORER 0x04000000
24
25#include <asm-generic/signal.h>
26
27#endif /* _ASM_ARC_SIGNAL_H */
diff --git a/arch/arc/include/uapi/asm/swab.h b/arch/arc/include/uapi/asm/swab.h
new file mode 100644
index 000000000000..095599a73195
--- /dev/null
+++ b/arch/arc/include/uapi/asm/swab.h
@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * vineetg: May 2011
9 * -Support single cycle endian-swap insn in ARC700 4.10
10 *
11 * vineetg: June 2009
12 * -Better htonl implementation (5 instead of 9 ALU instructions)
13 * -Hardware assisted single cycle bswap (Use Case of ARC custom instrn)
14 */
15
16#ifndef __ASM_ARC_SWAB_H
17#define __ASM_ARC_SWAB_H
18
19#include <linux/types.h>
20
21/* Native single cycle endian swap insn */
22#ifdef CONFIG_ARC_HAS_SWAPE
23
24#define __arch_swab32(x) \
25({ \
26 unsigned int tmp = x; \
27 __asm__( \
28 " swape %0, %1 \n" \
29 : "=r" (tmp) \
30 : "r" (tmp)); \
31 tmp; \
32})
33
34#else
35
36/* Several ways of Endian-Swap Emulation for ARC
37 * 0: kernel generic
38 * 1: ARC optimised "C"
39 * 2: ARC Custom instruction
40 */
41#define ARC_BSWAP_TYPE 1
42
43#if (ARC_BSWAP_TYPE == 1) /******* Software only ********/
44
45/* The kernel default implementation of htonl is
46 * return x<<24 | x>>24 |
47 * (x & (__u32)0x0000ff00UL)<<8 | (x & (__u32)0x00ff0000UL)>>8;
48 *
49 * This generates 9 instructions on ARC (excluding the ld/st)
50 *
51 * 8051fd8c: ld r3,[r7,20] ; Mem op : Get the value to be swapped
52 * 8051fd98: asl r5,r3,24 ; get 3rd Byte
53 * 8051fd9c: lsr r2,r3,24 ; get 0th Byte
54 * 8051fda0: and r4,r3,0xff00
55 * 8051fda8: asl r4,r4,8 ; get 1st Byte
56 * 8051fdac: and r3,r3,0x00ff0000
57 * 8051fdb4: or r2,r2,r5 ; combine 0th and 3rd Bytes
58 * 8051fdb8: lsr r3,r3,8 ; 2nd Byte at correct place in Dst Reg
59 * 8051fdbc: or r2,r2,r4 ; combine 0,3 Bytes with 1st Byte
60 * 8051fdc0: or r2,r2,r3 ; combine 0,3,1 Bytes with 2nd Byte
61 * 8051fdc4: st r2,[r1,20] ; Mem op : save result back to mem
62 *
63 * Joern suggested a better "C" algorithm which is great since
64 * (1) It is portable to any architecure
65 * (2) At the same time it takes advantage of ARC ISA (rotate intrns)
66 */
67
68#define __arch_swab32(x) \
69({ unsigned long __in = (x), __tmp; \
70 __tmp = __in << 8 | __in >> 24; /* ror tmp,in,24 */ \
71 __in = __in << 24 | __in >> 8; /* ror in,in,8 */ \
72 __tmp ^= __in; \
73 __tmp &= 0xff00ff; \
74 __tmp ^ __in; \
75})
76
77#elif (ARC_BSWAP_TYPE == 2) /* Custom single cycle bwap instruction */
78
79#define __arch_swab32(x) \
80({ \
81 unsigned int tmp = x; \
82 __asm__( \
83 " .extInstruction bswap, 7, 0x00, SUFFIX_NONE, SYNTAX_2OP \n"\
84 " bswap %0, %1 \n"\
85 : "=r" (tmp) \
86 : "r" (tmp)); \
87 tmp; \
88})
89
90#endif /* ARC_BSWAP_TYPE=zzz */
91
92#endif /* CONFIG_ARC_HAS_SWAPE */
93
94#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
95#define __SWAB_64_THRU_32__
96#endif
97
98#endif
diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h
new file mode 100644
index 000000000000..6f30484f34b7
--- /dev/null
+++ b/arch/arc/include/uapi/asm/unistd.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/******** no-legacy-syscalls-ABI *******/
10
11#define __ARCH_WANT_SYS_EXECVE
12#define __ARCH_WANT_SYS_CLONE
13#define __ARCH_WANT_SYS_VFORK
14#define __ARCH_WANT_SYS_FORK
15
16#define sys_mmap2 sys_mmap_pgoff
17
18#include <asm-generic/unistd.h>
19
20#define NR_syscalls __NR_syscalls
21
22/* ARC specific syscall */
23#define __NR_cacheflush (__NR_arch_specific_syscall + 0)
24#define __NR_arc_settls (__NR_arch_specific_syscall + 1)
25#define __NR_arc_gettls (__NR_arch_specific_syscall + 2)
26
27__SYSCALL(__NR_cacheflush, sys_cacheflush)
28__SYSCALL(__NR_arc_settls, sys_arc_settls)
29__SYSCALL(__NR_arc_gettls, sys_arc_gettls)
30
31
32/* Generic syscall (fs/filesystems.c - lost in asm-generic/unistd.h */
33#define __NR_sysfs (__NR_arch_specific_syscall + 3)
34__SYSCALL(__NR_sysfs, sys_sysfs)