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/head.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/head.h')
-rw-r--r-- | include/asm-sparc/head.h | 106 |
1 files changed, 6 insertions, 100 deletions
diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h index 7c35491a8b53..14652abdea31 100644 --- a/include/asm-sparc/head.h +++ b/include/asm-sparc/head.h | |||
@@ -1,102 +1,8 @@ | |||
1 | #ifndef __SPARC_HEAD_H | 1 | #ifndef ___ASM_SPARC_HEAD_H |
2 | #define __SPARC_HEAD_H | 2 | #define ___ASM_SPARC_HEAD_H |
3 | 3 | #if defined(__sparc__) && defined(__arch64__) | |
4 | #define KERNBASE 0xf0000000 /* First address the kernel will eventually be */ | 4 | #include <asm-sparc/head_64.h> |
5 | #define LOAD_ADDR 0x4000 /* prom jumps to us here unless this is elf /boot */ | ||
6 | #define SUN4C_SEGSZ (1 << 18) | ||
7 | #define SRMMU_L1_KBASE_OFFSET ((KERNBASE>>24)<<2) /* Used in boot remapping. */ | ||
8 | #define INTS_ENAB 0x01 /* entry.S uses this. */ | ||
9 | |||
10 | #define SUN4_PROM_VECTOR 0xFFE81000 /* SUN4 PROM needs to be hardwired */ | ||
11 | |||
12 | #define WRITE_PAUSE nop; nop; nop; /* Have to do this after %wim/%psr chg */ | ||
13 | #define NOP_INSN 0x01000000 /* Used to patch sparc_save_state */ | ||
14 | |||
15 | /* Here are some trap goodies */ | ||
16 | |||
17 | /* Generic trap entry. */ | ||
18 | #define TRAP_ENTRY(type, label) \ | ||
19 | rd %psr, %l0; b label; rd %wim, %l3; nop; | ||
20 | |||
21 | /* Data/text faults. Defaults to sun4c version at boot time. */ | ||
22 | #define SPARC_TFAULT rd %psr, %l0; rd %wim, %l3; b sun4c_fault; mov 1, %l7; | ||
23 | #define SPARC_DFAULT rd %psr, %l0; rd %wim, %l3; b sun4c_fault; mov 0, %l7; | ||
24 | #define SRMMU_TFAULT rd %psr, %l0; rd %wim, %l3; b srmmu_fault; mov 1, %l7; | ||
25 | #define SRMMU_DFAULT rd %psr, %l0; rd %wim, %l3; b srmmu_fault; mov 0, %l7; | ||
26 | |||
27 | /* This is for traps we should NEVER get. */ | ||
28 | #define BAD_TRAP(num) \ | ||
29 | rd %psr, %l0; mov num, %l7; b bad_trap_handler; rd %wim, %l3; | ||
30 | |||
31 | /* This is for traps when we want just skip the instruction which caused it */ | ||
32 | #define SKIP_TRAP(type, name) \ | ||
33 | jmpl %l2, %g0; rett %l2 + 4; nop; nop; | ||
34 | |||
35 | /* Notice that for the system calls we pull a trick. We load up a | ||
36 | * different pointer to the system call vector table in %l7, but call | ||
37 | * the same generic system call low-level entry point. The trap table | ||
38 | * entry sequences are also HyperSparc pipeline friendly ;-) | ||
39 | */ | ||
40 | |||
41 | /* Software trap for Linux system calls. */ | ||
42 | #define LINUX_SYSCALL_TRAP \ | ||
43 | sethi %hi(sys_call_table), %l7; \ | ||
44 | or %l7, %lo(sys_call_table), %l7; \ | ||
45 | b linux_sparc_syscall; \ | ||
46 | rd %psr, %l0; | ||
47 | |||
48 | #define BREAKPOINT_TRAP \ | ||
49 | b breakpoint_trap; \ | ||
50 | rd %psr,%l0; \ | ||
51 | nop; \ | ||
52 | nop; | ||
53 | |||
54 | #ifdef CONFIG_KGDB | ||
55 | #define KGDB_TRAP(num) \ | ||
56 | b kgdb_trap_low; \ | ||
57 | rd %psr,%l0; \ | ||
58 | nop; \ | ||
59 | nop; | ||
60 | #else | 5 | #else |
61 | #define KGDB_TRAP(num) \ | 6 | #include <asm-sparc/head_32.h> |
62 | BAD_TRAP(num) | 7 | #endif |
63 | #endif | 8 | #endif |
64 | |||
65 | /* The Get Condition Codes software trap for userland. */ | ||
66 | #define GETCC_TRAP \ | ||
67 | b getcc_trap_handler; mov %psr, %l0; nop; nop; | ||
68 | |||
69 | /* The Set Condition Codes software trap for userland. */ | ||
70 | #define SETCC_TRAP \ | ||
71 | b setcc_trap_handler; mov %psr, %l0; nop; nop; | ||
72 | |||
73 | /* The Get PSR software trap for userland. */ | ||
74 | #define GETPSR_TRAP \ | ||
75 | mov %psr, %i0; jmp %l2; rett %l2 + 4; nop; | ||
76 | |||
77 | /* This is for hard interrupts from level 1-14, 15 is non-maskable (nmi) and | ||
78 | * gets handled with another macro. | ||
79 | */ | ||
80 | #define TRAP_ENTRY_INTERRUPT(int_level) \ | ||
81 | mov int_level, %l7; rd %psr, %l0; b real_irq_entry; rd %wim, %l3; | ||
82 | |||
83 | /* NMI's (Non Maskable Interrupts) are special, you can't keep them | ||
84 | * from coming in, and basically if you get one, the shows over. ;( | ||
85 | * On the sun4c they are usually asynchronous memory errors, on the | ||
86 | * the sun4m they could be either due to mem errors or a software | ||
87 | * initiated interrupt from the prom/kern on an SMP box saying "I | ||
88 | * command you to do CPU tricks, read your mailbox for more info." | ||
89 | */ | ||
90 | #define NMI_TRAP \ | ||
91 | rd %wim, %l3; b linux_trap_nmi_sun4c; mov %psr, %l0; nop; | ||
92 | |||
93 | /* Window overflows/underflows are special and we need to try to be as | ||
94 | * efficient as possible here.... | ||
95 | */ | ||
96 | #define WINDOW_SPILL \ | ||
97 | rd %psr, %l0; rd %wim, %l3; b spill_window_entry; andcc %l0, PSR_PS, %g0; | ||
98 | |||
99 | #define WINDOW_FILL \ | ||
100 | rd %psr, %l0; rd %wim, %l3; b fill_window_entry; andcc %l0, PSR_PS, %g0; | ||
101 | |||
102 | #endif /* __SPARC_HEAD_H */ | ||