diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-07-18 00:55:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 00:55:51 -0400 |
commit | f5e706ad886b6a5eb59637830110b09ccebf01c5 (patch) | |
tree | ea043a0a28e16a2ac6395c35d737f52698a165b7 /include/asm-sparc/processor.h | |
parent | 5e3609f60c09f0f15f71f80c6d7933b2c7be71a6 (diff) |
sparc: join the remaining header files
With this commit all sparc64 header files are moved to asm-sparc.
The remaining files (71 files) were too different to be trivially
merged so divide them up in a _32.h and a _64.h file which
are both included from the file with no bit size.
The following script were used:
cd include
FILES=`wc -l asm-sparc64/*h | grep -v '^ 1' | cut -b 20-`
for FILE in ${FILES}; do
echo $FILE:
BASE=`echo $FILE | cut -d '.' -f 1`
FN32=${BASE}_32.h
FN64=${BASE}_64.h
GUARD=___ASM_SPARC_`echo $BASE | tr '-' '_' | tr [:lower:] [:upper:]`_H
git mv asm-sparc/$FILE asm-sparc/$FN32
git mv asm-sparc64/$FILE asm-sparc/$FN64
echo git mv done
printf "#ifndef %s\n" $GUARD > asm-sparc/$FILE
printf "#define %s\n" $GUARD >> asm-sparc/$FILE
printf "#if defined(__sparc__) && defined(__arch64__)\n" >> asm-sparc/$FILE
printf "#include <asm-sparc/%s>\n" $FN64 >> asm-sparc/$FILE
printf "#else\n" >> asm-sparc/$FILE
printf "#include <asm-sparc/%s>\n" $FN32 >> asm-sparc/$FILE
printf "#endif\n" >> asm-sparc/$FILE
printf "#endif\n" >> asm-sparc/$FILE
git add asm-sparc/$FILE
echo new file done
printf "#include <asm-sparc/%s>\n" $FILE > asm-sparc64/$FILE
git add asm-sparc64/$FILE
echo sparc64 file done
done
The guard contains three '_' to avoid conflict with existing guards.
In additing the two Kbuild files are emptied to avoid breaking
headers_* targets.
We will reintroduce the exported header files when the necessary
kbuild changes are merged.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc/processor.h')
-rw-r--r-- | include/asm-sparc/processor.h | 132 |
1 files changed, 6 insertions, 126 deletions
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index 8898efbbbe07..11a66bb02eaa 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h | |||
@@ -1,128 +1,8 @@ | |||
1 | /* include/asm-sparc/processor.h | 1 | #ifndef ___ASM_SPARC_PROCESSOR_H |
2 | * | 2 | #define ___ASM_SPARC_PROCESSOR_H |
3 | * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) | 3 | #if defined(__sparc__) && defined(__arch64__) |
4 | */ | 4 | #include <asm-sparc/processor_64.h> |
5 | 5 | #else | |
6 | #ifndef __ASM_SPARC_PROCESSOR_H | 6 | #include <asm-sparc/processor_32.h> |
7 | #define __ASM_SPARC_PROCESSOR_H | ||
8 | |||
9 | /* | ||
10 | * Sparc32 implementation of macro that returns current | ||
11 | * instruction pointer ("program counter"). | ||
12 | */ | ||
13 | #define current_text_addr() ({ void *pc; __asm__("sethi %%hi(1f), %0; or %0, %%lo(1f), %0;\n1:" : "=r" (pc)); pc; }) | ||
14 | |||
15 | #include <asm/psr.h> | ||
16 | #include <asm/ptrace.h> | ||
17 | #include <asm/head.h> | ||
18 | #include <asm/signal.h> | ||
19 | #include <asm/btfixup.h> | ||
20 | #include <asm/page.h> | ||
21 | |||
22 | /* | ||
23 | * The sparc has no problems with write protection | ||
24 | */ | ||
25 | #define wp_works_ok 1 | ||
26 | #define wp_works_ok__is_a_macro /* for versions in ksyms.c */ | ||
27 | |||
28 | /* Whee, this is STACK_TOP + PAGE_SIZE and the lowest kernel address too... | ||
29 | * That one page is used to protect kernel from intruders, so that | ||
30 | * we can make our access_ok test faster | ||
31 | */ | ||
32 | #define TASK_SIZE PAGE_OFFSET | ||
33 | #ifdef __KERNEL__ | ||
34 | #define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) | ||
35 | #define STACK_TOP_MAX STACK_TOP | ||
36 | #endif /* __KERNEL__ */ | ||
37 | |||
38 | struct task_struct; | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | struct fpq { | ||
42 | unsigned long *insn_addr; | ||
43 | unsigned long insn; | ||
44 | }; | ||
45 | #endif | 7 | #endif |
46 | |||
47 | typedef struct { | ||
48 | int seg; | ||
49 | } mm_segment_t; | ||
50 | |||
51 | /* The Sparc processor specific thread struct. */ | ||
52 | struct thread_struct { | ||
53 | struct pt_regs *kregs; | ||
54 | unsigned int _pad1; | ||
55 | |||
56 | /* Special child fork kpsr/kwim values. */ | ||
57 | unsigned long fork_kpsr __attribute__ ((aligned (8))); | ||
58 | unsigned long fork_kwim; | ||
59 | |||
60 | /* Floating point regs */ | ||
61 | unsigned long float_regs[32] __attribute__ ((aligned (8))); | ||
62 | unsigned long fsr; | ||
63 | unsigned long fpqdepth; | ||
64 | struct fpq fpqueue[16]; | ||
65 | unsigned long flags; | ||
66 | mm_segment_t current_ds; | ||
67 | }; | ||
68 | |||
69 | #define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */ | ||
70 | #define SPARC_FLAG_UNALIGNED 0x2 /* is allowed to do unaligned accesses */ | ||
71 | |||
72 | #define INIT_THREAD { \ | ||
73 | .flags = SPARC_FLAG_KTHREAD, \ | ||
74 | .current_ds = KERNEL_DS, \ | ||
75 | } | ||
76 | |||
77 | /* Return saved PC of a blocked thread. */ | ||
78 | extern unsigned long thread_saved_pc(struct task_struct *t); | ||
79 | |||
80 | /* Do necessary setup to start up a newly executed thread. */ | ||
81 | static inline void start_thread(struct pt_regs * regs, unsigned long pc, | ||
82 | unsigned long sp) | ||
83 | { | ||
84 | register unsigned long zero asm("g1"); | ||
85 | |||
86 | regs->psr = (regs->psr & (PSR_CWP)) | PSR_S; | ||
87 | regs->pc = ((pc & (~3)) - 4); | ||
88 | regs->npc = regs->pc + 4; | ||
89 | regs->y = 0; | ||
90 | zero = 0; | ||
91 | __asm__ __volatile__("std\t%%g0, [%0 + %3 + 0x00]\n\t" | ||
92 | "std\t%%g0, [%0 + %3 + 0x08]\n\t" | ||
93 | "std\t%%g0, [%0 + %3 + 0x10]\n\t" | ||
94 | "std\t%%g0, [%0 + %3 + 0x18]\n\t" | ||
95 | "std\t%%g0, [%0 + %3 + 0x20]\n\t" | ||
96 | "std\t%%g0, [%0 + %3 + 0x28]\n\t" | ||
97 | "std\t%%g0, [%0 + %3 + 0x30]\n\t" | ||
98 | "st\t%1, [%0 + %3 + 0x38]\n\t" | ||
99 | "st\t%%g0, [%0 + %3 + 0x3c]" | ||
100 | : /* no outputs */ | ||
101 | : "r" (regs), | ||
102 | "r" (sp - sizeof(struct reg_window)), | ||
103 | "r" (zero), | ||
104 | "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0])) | ||
105 | : "memory"); | ||
106 | } | ||
107 | |||
108 | /* Free all resources held by a thread. */ | ||
109 | #define release_thread(tsk) do { } while(0) | ||
110 | extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | ||
111 | |||
112 | /* Prepare to copy thread state - unlazy all lazy status */ | ||
113 | #define prepare_to_copy(tsk) do { } while (0) | ||
114 | |||
115 | extern unsigned long get_wchan(struct task_struct *); | ||
116 | |||
117 | #define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc) | ||
118 | #define KSTK_ESP(tsk) ((tsk)->thread.kregs->u_regs[UREG_FP]) | ||
119 | |||
120 | #ifdef __KERNEL__ | ||
121 | |||
122 | extern struct task_struct *last_task_used_math; | ||
123 | |||
124 | #define cpu_relax() barrier() | ||
125 | |||
126 | #endif | 8 | #endif |
127 | |||
128 | #endif /* __ASM_SPARC_PROCESSOR_H */ | ||