Skip to content

Commit cb8db5d

Browse files
committed
UAPI: (Scripted) Disintegrate arch/arm/include/asm
Signed-off-by: David Howells <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Michael Kerrisk <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Acked-by: Dave Jones <[email protected]>
1 parent 4f1cd91 commit cb8db5d

24 files changed

+1006
-926
lines changed

arch/arm/include/asm/Kbuild

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
include include/asm-generic/Kbuild.asm
21

3-
header-y += hwcap.h
42

53
generic-y += auxvec.h
64
generic-y += bitsperlong.h

arch/arm/include/asm/hwcap.h

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,8 @@
11
#ifndef __ASMARM_HWCAP_H
22
#define __ASMARM_HWCAP_H
33

4-
/*
5-
* HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
6-
*/
7-
#define HWCAP_SWP (1 << 0)
8-
#define HWCAP_HALF (1 << 1)
9-
#define HWCAP_THUMB (1 << 2)
10-
#define HWCAP_26BIT (1 << 3) /* Play it safe */
11-
#define HWCAP_FAST_MULT (1 << 4)
12-
#define HWCAP_FPA (1 << 5)
13-
#define HWCAP_VFP (1 << 6)
14-
#define HWCAP_EDSP (1 << 7)
15-
#define HWCAP_JAVA (1 << 8)
16-
#define HWCAP_IWMMXT (1 << 9)
17-
#define HWCAP_CRUNCH (1 << 10)
18-
#define HWCAP_THUMBEE (1 << 11)
19-
#define HWCAP_NEON (1 << 12)
20-
#define HWCAP_VFPv3 (1 << 13)
21-
#define HWCAP_VFPv3D16 (1 << 14)
22-
#define HWCAP_TLS (1 << 15)
23-
#define HWCAP_VFPv4 (1 << 16)
24-
#define HWCAP_IDIVA (1 << 17)
25-
#define HWCAP_IDIVT (1 << 18)
26-
#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
4+
#include <uapi/asm/hwcap.h>
275

28-
#if defined(__KERNEL__)
296
#if !defined(__ASSEMBLY__)
307
/*
318
* This yields a mask that user programs can use to figure out what
@@ -35,5 +12,3 @@
3512
extern unsigned int elf_hwcap;
3613
#endif
3714
#endif
38-
39-
#endif

arch/arm/include/asm/ptrace.h

Lines changed: 1 addition & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -10,133 +10,12 @@
1010
#ifndef __ASM_ARM_PTRACE_H
1111
#define __ASM_ARM_PTRACE_H
1212

13-
#include <asm/hwcap.h>
14-
15-
#define PTRACE_GETREGS 12
16-
#define PTRACE_SETREGS 13
17-
#define PTRACE_GETFPREGS 14
18-
#define PTRACE_SETFPREGS 15
19-
/* PTRACE_ATTACH is 16 */
20-
/* PTRACE_DETACH is 17 */
21-
#define PTRACE_GETWMMXREGS 18
22-
#define PTRACE_SETWMMXREGS 19
23-
/* 20 is unused */
24-
#define PTRACE_OLDSETOPTIONS 21
25-
#define PTRACE_GET_THREAD_AREA 22
26-
#define PTRACE_SET_SYSCALL 23
27-
/* PTRACE_SYSCALL is 24 */
28-
#define PTRACE_GETCRUNCHREGS 25
29-
#define PTRACE_SETCRUNCHREGS 26
30-
#define PTRACE_GETVFPREGS 27
31-
#define PTRACE_SETVFPREGS 28
32-
#define PTRACE_GETHBPREGS 29
33-
#define PTRACE_SETHBPREGS 30
34-
35-
/*
36-
* PSR bits
37-
*/
38-
#define USR26_MODE 0x00000000
39-
#define FIQ26_MODE 0x00000001
40-
#define IRQ26_MODE 0x00000002
41-
#define SVC26_MODE 0x00000003
42-
#define USR_MODE 0x00000010
43-
#define FIQ_MODE 0x00000011
44-
#define IRQ_MODE 0x00000012
45-
#define SVC_MODE 0x00000013
46-
#define ABT_MODE 0x00000017
47-
#define HYP_MODE 0x0000001a
48-
#define UND_MODE 0x0000001b
49-
#define SYSTEM_MODE 0x0000001f
50-
#define MODE32_BIT 0x00000010
51-
#define MODE_MASK 0x0000001f
52-
#define PSR_T_BIT 0x00000020
53-
#define PSR_F_BIT 0x00000040
54-
#define PSR_I_BIT 0x00000080
55-
#define PSR_A_BIT 0x00000100
56-
#define PSR_E_BIT 0x00000200
57-
#define PSR_J_BIT 0x01000000
58-
#define PSR_Q_BIT 0x08000000
59-
#define PSR_V_BIT 0x10000000
60-
#define PSR_C_BIT 0x20000000
61-
#define PSR_Z_BIT 0x40000000
62-
#define PSR_N_BIT 0x80000000
63-
64-
/*
65-
* Groups of PSR bits
66-
*/
67-
#define PSR_f 0xff000000 /* Flags */
68-
#define PSR_s 0x00ff0000 /* Status */
69-
#define PSR_x 0x0000ff00 /* Extension */
70-
#define PSR_c 0x000000ff /* Control */
71-
72-
/*
73-
* ARMv7 groups of PSR bits
74-
*/
75-
#define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */
76-
#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
77-
#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
78-
#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
79-
80-
/*
81-
* Default endianness state
82-
*/
83-
#ifdef CONFIG_CPU_ENDIAN_BE8
84-
#define PSR_ENDSTATE PSR_E_BIT
85-
#else
86-
#define PSR_ENDSTATE 0
87-
#endif
88-
89-
/*
90-
* These are 'magic' values for PTRACE_PEEKUSR that return info about where a
91-
* process is located in memory.
92-
*/
93-
#define PT_TEXT_ADDR 0x10000
94-
#define PT_DATA_ADDR 0x10004
95-
#define PT_TEXT_END_ADDR 0x10008
13+
#include <uapi/asm/ptrace.h>
9614

9715
#ifndef __ASSEMBLY__
98-
99-
/*
100-
* This struct defines the way the registers are stored on the
101-
* stack during a system call. Note that sizeof(struct pt_regs)
102-
* has to be a multiple of 8.
103-
*/
104-
#ifndef __KERNEL__
105-
struct pt_regs {
106-
long uregs[18];
107-
};
108-
#else /* __KERNEL__ */
10916
struct pt_regs {
11017
unsigned long uregs[18];
11118
};
112-
#endif /* __KERNEL__ */
113-
114-
#define ARM_cpsr uregs[16]
115-
#define ARM_pc uregs[15]
116-
#define ARM_lr uregs[14]
117-
#define ARM_sp uregs[13]
118-
#define ARM_ip uregs[12]
119-
#define ARM_fp uregs[11]
120-
#define ARM_r10 uregs[10]
121-
#define ARM_r9 uregs[9]
122-
#define ARM_r8 uregs[8]
123-
#define ARM_r7 uregs[7]
124-
#define ARM_r6 uregs[6]
125-
#define ARM_r5 uregs[5]
126-
#define ARM_r4 uregs[4]
127-
#define ARM_r3 uregs[3]
128-
#define ARM_r2 uregs[2]
129-
#define ARM_r1 uregs[1]
130-
#define ARM_r0 uregs[0]
131-
#define ARM_ORIG_r0 uregs[17]
132-
133-
/*
134-
* The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
135-
* and core dumps.
136-
*/
137-
#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
138-
139-
#ifdef __KERNEL__
14019

14120
#define user_mode(regs) \
14221
(((regs)->ARM_cpsr & 0xf) == 0)
@@ -260,9 +139,5 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
260139
(struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1; \
261140
})
262141

263-
#endif /* __KERNEL__ */
264-
265142
#endif /* __ASSEMBLY__ */
266-
267143
#endif
268-

arch/arm/include/asm/setup.h

Lines changed: 1 addition & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -14,176 +14,8 @@
1414
#ifndef __ASMARM_SETUP_H
1515
#define __ASMARM_SETUP_H
1616

17-
#include <linux/types.h>
17+
#include <uapi/asm/setup.h>
1818

19-
#define COMMAND_LINE_SIZE 1024
20-
21-
/* The list ends with an ATAG_NONE node. */
22-
#define ATAG_NONE 0x00000000
23-
24-
struct tag_header {
25-
__u32 size;
26-
__u32 tag;
27-
};
28-
29-
/* The list must start with an ATAG_CORE node */
30-
#define ATAG_CORE 0x54410001
31-
32-
struct tag_core {
33-
__u32 flags; /* bit 0 = read-only */
34-
__u32 pagesize;
35-
__u32 rootdev;
36-
};
37-
38-
/* it is allowed to have multiple ATAG_MEM nodes */
39-
#define ATAG_MEM 0x54410002
40-
41-
struct tag_mem32 {
42-
__u32 size;
43-
__u32 start; /* physical start address */
44-
};
45-
46-
/* VGA text type displays */
47-
#define ATAG_VIDEOTEXT 0x54410003
48-
49-
struct tag_videotext {
50-
__u8 x;
51-
__u8 y;
52-
__u16 video_page;
53-
__u8 video_mode;
54-
__u8 video_cols;
55-
__u16 video_ega_bx;
56-
__u8 video_lines;
57-
__u8 video_isvga;
58-
__u16 video_points;
59-
};
60-
61-
/* describes how the ramdisk will be used in kernel */
62-
#define ATAG_RAMDISK 0x54410004
63-
64-
struct tag_ramdisk {
65-
__u32 flags; /* bit 0 = load, bit 1 = prompt */
66-
__u32 size; /* decompressed ramdisk size in _kilo_ bytes */
67-
__u32 start; /* starting block of floppy-based RAM disk image */
68-
};
69-
70-
/* describes where the compressed ramdisk image lives (virtual address) */
71-
/*
72-
* this one accidentally used virtual addresses - as such,
73-
* it's deprecated.
74-
*/
75-
#define ATAG_INITRD 0x54410005
76-
77-
/* describes where the compressed ramdisk image lives (physical address) */
78-
#define ATAG_INITRD2 0x54420005
79-
80-
struct tag_initrd {
81-
__u32 start; /* physical start address */
82-
__u32 size; /* size of compressed ramdisk image in bytes */
83-
};
84-
85-
/* board serial number. "64 bits should be enough for everybody" */
86-
#define ATAG_SERIAL 0x54410006
87-
88-
struct tag_serialnr {
89-
__u32 low;
90-
__u32 high;
91-
};
92-
93-
/* board revision */
94-
#define ATAG_REVISION 0x54410007
95-
96-
struct tag_revision {
97-
__u32 rev;
98-
};
99-
100-
/* initial values for vesafb-type framebuffers. see struct screen_info
101-
* in include/linux/tty.h
102-
*/
103-
#define ATAG_VIDEOLFB 0x54410008
104-
105-
struct tag_videolfb {
106-
__u16 lfb_width;
107-
__u16 lfb_height;
108-
__u16 lfb_depth;
109-
__u16 lfb_linelength;
110-
__u32 lfb_base;
111-
__u32 lfb_size;
112-
__u8 red_size;
113-
__u8 red_pos;
114-
__u8 green_size;
115-
__u8 green_pos;
116-
__u8 blue_size;
117-
__u8 blue_pos;
118-
__u8 rsvd_size;
119-
__u8 rsvd_pos;
120-
};
121-
122-
/* command line: \0 terminated string */
123-
#define ATAG_CMDLINE 0x54410009
124-
125-
struct tag_cmdline {
126-
char cmdline[1]; /* this is the minimum size */
127-
};
128-
129-
/* acorn RiscPC specific information */
130-
#define ATAG_ACORN 0x41000101
131-
132-
struct tag_acorn {
133-
__u32 memc_control_reg;
134-
__u32 vram_pages;
135-
__u8 sounddefault;
136-
__u8 adfsdrives;
137-
};
138-
139-
/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
140-
#define ATAG_MEMCLK 0x41000402
141-
142-
struct tag_memclk {
143-
__u32 fmemclk;
144-
};
145-
146-
struct tag {
147-
struct tag_header hdr;
148-
union {
149-
struct tag_core core;
150-
struct tag_mem32 mem;
151-
struct tag_videotext videotext;
152-
struct tag_ramdisk ramdisk;
153-
struct tag_initrd initrd;
154-
struct tag_serialnr serialnr;
155-
struct tag_revision revision;
156-
struct tag_videolfb videolfb;
157-
struct tag_cmdline cmdline;
158-
159-
/*
160-
* Acorn specific
161-
*/
162-
struct tag_acorn acorn;
163-
164-
/*
165-
* DC21285 specific
166-
*/
167-
struct tag_memclk memclk;
168-
} u;
169-
};
170-
171-
struct tagtable {
172-
__u32 tag;
173-
int (*parse)(const struct tag *);
174-
};
175-
176-
#define tag_member_present(tag,member) \
177-
((unsigned long)(&((struct tag *)0L)->member + 1) \
178-
<= (tag)->hdr.size * 4)
179-
180-
#define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
181-
#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
182-
183-
#define for_each_tag(t,base) \
184-
for (t = base; t->hdr.size; t = tag_next(t))
185-
186-
#ifdef __KERNEL__
18719

18820
#define __tag __used __attribute__((__section__(".taglist.init")))
18921
#define __tagtable(tag, fn) \
@@ -221,6 +53,4 @@ extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
22153
extern void early_print(const char *str, ...);
22254
extern void dump_machine_table(void);
22355

224-
#endif /* __KERNEL__ */
225-
22656
#endif

0 commit comments

Comments
 (0)