aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc')
-rw-r--r--include/asm-sparc/head.h11
-rw-r--r--include/asm-sparc/kgdb.h116
-rw-r--r--include/asm-sparc/mman.h5
-rw-r--r--include/asm-sparc/oplib.h17
-rw-r--r--include/asm-sparc/page.h5
-rw-r--r--include/asm-sparc/psr.h1
-rw-r--r--include/asm-sparc/ptrace.h13
-rw-r--r--include/asm-sparc/signal.h8
-rw-r--r--include/asm-sparc/smp.h2
-rw-r--r--include/asm-sparc/system.h2
-rw-r--r--include/asm-sparc/types.h30
-rw-r--r--include/asm-sparc/unaligned.h10
12 files changed, 70 insertions, 150 deletions
diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h
index fcdba5116339..e6532c3e09c9 100644
--- a/include/asm-sparc/head.h
+++ b/include/asm-sparc/head.h
@@ -52,6 +52,17 @@
52 nop; \ 52 nop; \
53 nop; 53 nop;
54 54
55#ifdef CONFIG_KGDB
56#define KGDB_TRAP(num) \
57 b kgdb_trap_low; \
58 rd %psr,%l0; \
59 nop; \
60 nop;
61#else
62#define KGDB_TRAP(num) \
63 BAD_TRAP(num)
64#endif
65
55/* The Get Condition Codes software trap for userland. */ 66/* The Get Condition Codes software trap for userland. */
56#define GETCC_TRAP \ 67#define GETCC_TRAP \
57 b getcc_trap_handler; mov %psr, %l0; nop; nop; 68 b getcc_trap_handler; mov %psr, %l0; nop; nop;
diff --git a/include/asm-sparc/kgdb.h b/include/asm-sparc/kgdb.h
index d120adfb429f..b6ef301d05bf 100644
--- a/include/asm-sparc/kgdb.h
+++ b/include/asm-sparc/kgdb.h
@@ -1,94 +1,38 @@
1/* $Id: kgdb.h,v 1.8 1998/01/07 06:33:44 baccala Exp $
2 * kgdb.h: Defines and declarations for serial line source level
3 * remote debugging of the Linux kernel using gdb.
4 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */
7#ifndef _SPARC_KGDB_H 1#ifndef _SPARC_KGDB_H
8#define _SPARC_KGDB_H 2#define _SPARC_KGDB_H
9 3
10#ifndef __ASSEMBLY__ 4#ifdef CONFIG_SPARC32
11/* To init the kgdb engine. */ 5#define BUFMAX 2048
12extern void set_debug_traps(void); 6#else
13 7#define BUFMAX 4096
14/* To enter the debugger explicitly. */ 8#endif
15extern void breakpoint(void); 9
16 10enum regnames {
17/* For convenience we define the format of a kgdb trap breakpoint 11 GDB_G0, GDB_G1, GDB_G2, GDB_G3, GDB_G4, GDB_G5, GDB_G6, GDB_G7,
18 * frame here also. 12 GDB_O0, GDB_O1, GDB_O2, GDB_O3, GDB_O4, GDB_O5, GDB_SP, GDB_O7,
19 */ 13 GDB_L0, GDB_L1, GDB_L2, GDB_L3, GDB_L4, GDB_L5, GDB_L6, GDB_L7,
20struct kgdb_frame { 14 GDB_I0, GDB_I1, GDB_I2, GDB_I3, GDB_I4, GDB_I5, GDB_FP, GDB_I7,
21 unsigned long globals[8]; 15 GDB_F0,
22 unsigned long outs[8]; 16 GDB_F31 = GDB_F0 + 31,
23 unsigned long locals[8]; 17#ifdef CONFIG_SPARC32
24 unsigned long ins[8]; 18 GDB_Y, GDB_PSR, GDB_WIM, GDB_TBR, GDB_PC, GDB_NPC,
25 unsigned long fpregs[32]; 19 GDB_FSR, GDB_CSR,
26 unsigned long y; 20#else
27 unsigned long psr; 21 GDB_F32 = GDB_F0 + 32,
28 unsigned long wim; 22 GDB_F62 = GDB_F32 + 15,
29 unsigned long tbr; 23 GDB_PC, GDB_NPC, GDB_STATE, GDB_FSR, GDB_FPRS, GDB_Y,
30 unsigned long pc; 24#endif
31 unsigned long npc;
32 unsigned long fpsr;
33 unsigned long cpsr;
34}; 25};
35#endif /* !(__ASSEMBLY__) */
36
37/* Macros for assembly usage of the kgdb breakpoint frame. */
38#define KGDB_G0 0x000
39#define KGDB_G1 0x004
40#define KGDB_G2 0x008
41#define KGDB_G4 0x010
42#define KGDB_G6 0x018
43#define KGDB_I0 0x020
44#define KGDB_I2 0x028
45#define KGDB_I4 0x030
46#define KGDB_I6 0x038
47#define KGDB_Y 0x100
48#define KGDB_PSR 0x104
49#define KGDB_WIM 0x108
50#define KGDB_TBR 0x10c
51#define KGDB_PC 0x110
52#define KGDB_NPC 0x114
53
54#define SAVE_KGDB_GLOBALS(reg) \
55 std %g0, [%reg + STACKFRAME_SZ + KGDB_G0]; \
56 std %g2, [%reg + STACKFRAME_SZ + KGDB_G2]; \
57 std %g4, [%reg + STACKFRAME_SZ + KGDB_G4]; \
58 std %g6, [%reg + STACKFRAME_SZ + KGDB_G6];
59
60#define SAVE_KGDB_INS(reg) \
61 std %i0, [%reg + STACKFRAME_SZ + KGDB_I0]; \
62 std %i2, [%reg + STACKFRAME_SZ + KGDB_I2]; \
63 std %i4, [%reg + STACKFRAME_SZ + KGDB_I4]; \
64 std %i6, [%reg + STACKFRAME_SZ + KGDB_I6];
65
66#define SAVE_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
67 st %reg_y, [%reg + STACKFRAME_SZ + KGDB_Y]; \
68 st %reg_psr, [%reg + STACKFRAME_SZ + KGDB_PSR]; \
69 st %reg_wim, [%reg + STACKFRAME_SZ + KGDB_WIM]; \
70 st %reg_tbr, [%reg + STACKFRAME_SZ + KGDB_TBR]; \
71 st %reg_pc, [%reg + STACKFRAME_SZ + KGDB_PC]; \
72 st %reg_npc, [%reg + STACKFRAME_SZ + KGDB_NPC];
73 26
74#define LOAD_KGDB_GLOBALS(reg) \ 27#ifdef CONFIG_SPARC32
75 ld [%reg + STACKFRAME_SZ + KGDB_G1], %g1; \ 28#define NUMREGBYTES ((GDB_CSR + 1) * 4)
76 ldd [%reg + STACKFRAME_SZ + KGDB_G2], %g2; \ 29#else
77 ldd [%reg + STACKFRAME_SZ + KGDB_G4], %g4; \ 30#define NUMREGBYTES ((GDB_Y + 1) * 8)
78 ldd [%reg + STACKFRAME_SZ + KGDB_G6], %g6; 31#endif
79 32
80#define LOAD_KGDB_INS(reg) \ 33extern void arch_kgdb_breakpoint(void);
81 ldd [%reg + STACKFRAME_SZ + KGDB_I0], %i0; \
82 ldd [%reg + STACKFRAME_SZ + KGDB_I2], %i2; \
83 ldd [%reg + STACKFRAME_SZ + KGDB_I4], %i4; \
84 ldd [%reg + STACKFRAME_SZ + KGDB_I6], %i6;
85 34
86#define LOAD_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \ 35#define BREAK_INSTR_SIZE 4
87 ld [%reg + STACKFRAME_SZ + KGDB_Y], %reg_y; \ 36#define CACHE_FLUSH_IS_SAFE 1
88 ld [%reg + STACKFRAME_SZ + KGDB_PSR], %reg_psr; \
89 ld [%reg + STACKFRAME_SZ + KGDB_WIM], %reg_wim; \
90 ld [%reg + STACKFRAME_SZ + KGDB_TBR], %reg_tbr; \
91 ld [%reg + STACKFRAME_SZ + KGDB_PC], %reg_pc; \
92 ld [%reg + STACKFRAME_SZ + KGDB_NPC], %reg_npc;
93 37
94#endif /* !(_SPARC_KGDB_H) */ 38#endif /* _SPARC_KGDB_H */
diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h
index e18be984c01d..3d16b40bb8ef 100644
--- a/include/asm-sparc/mman.h
+++ b/include/asm-sparc/mman.h
@@ -24,9 +24,8 @@
24 24
25#ifdef __KERNEL__ 25#ifdef __KERNEL__
26#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
27#define arch_mmap_check sparc_mmap_check 27#define arch_mmap_check(addr,len,flags) sparc_mmap_check(addr,len)
28int sparc_mmap_check(unsigned long addr, unsigned long len, 28int sparc_mmap_check(unsigned long addr, unsigned long len);
29 unsigned long flags);
30#endif 29#endif
31#endif 30#endif
32 31
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index 17ba82ee220a..7becc846544a 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -34,9 +34,6 @@ extern unsigned int prom_rev, prom_prev;
34 */ 34 */
35extern int prom_root_node; 35extern int prom_root_node;
36 36
37/* PROM stdin and stdout */
38extern int prom_stdin, prom_stdout;
39
40/* Pointer to prom structure containing the device tree traversal 37/* Pointer to prom structure containing the device tree traversal
41 * and usage utility functions. Only prom-lib should use these, 38 * and usage utility functions. Only prom-lib should use these,
42 * users use the interface defined by the library only! 39 * users use the interface defined by the library only!
@@ -84,20 +81,6 @@ extern int prom_devclose(int device_handle);
84extern void prom_seek(int device_handle, unsigned int seek_hival, 81extern void prom_seek(int device_handle, unsigned int seek_hival,
85 unsigned int seek_lowval); 82 unsigned int seek_lowval);
86 83
87/* Machine memory configuration routine. */
88
89/* This function returns a V0 format memory descriptor table, it has three
90 * entries. One for the total amount of physical ram on the machine, one
91 * for the amount of physical ram available, and one describing the virtual
92 * areas which are allocated by the prom. So, in a sense the physical
93 * available is a calculation of the total physical minus the physical mapped
94 * by the prom with virtual mappings.
95 *
96 * These lists are returned pre-sorted, this should make your life easier
97 * since the prom itself is way too lazy to do such nice things.
98 */
99extern struct linux_mem_v0 *prom_meminfo(void);
100
101/* Miscellaneous routines, don't really fit in any category per se. */ 84/* Miscellaneous routines, don't really fit in any category per se. */
102 85
103/* Reboot the machine with the command line passed. */ 86/* Reboot the machine with the command line passed. */
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
index 39ccf2da297c..1625a8c3e0d2 100644
--- a/include/asm-sparc/page.h
+++ b/include/asm-sparc/page.h
@@ -38,12 +38,11 @@
38 38
39/* The following structure is used to hold the physical 39/* The following structure is used to hold the physical
40 * memory configuration of the machine. This is filled in 40 * memory configuration of the machine. This is filled in
41 * probe_memory() and is later used by mem_init() to set up 41 * prom_meminit() and is later used by mem_init() to set up
42 * mem_map[]. We statically allocate SPARC_PHYS_BANKS of 42 * mem_map[]. We statically allocate SPARC_PHYS_BANKS+1 of
43 * these structs, this is arbitrary. The entry after the 43 * these structs, this is arbitrary. The entry after the
44 * last valid one has num_bytes==0. 44 * last valid one has num_bytes==0.
45 */ 45 */
46
47struct sparc_phys_banks { 46struct sparc_phys_banks {
48 unsigned long base_addr; 47 unsigned long base_addr;
49 unsigned long num_bytes; 48 unsigned long num_bytes;
diff --git a/include/asm-sparc/psr.h b/include/asm-sparc/psr.h
index 19c978051118..213970477a24 100644
--- a/include/asm-sparc/psr.h
+++ b/include/asm-sparc/psr.h
@@ -25,6 +25,7 @@
25#define PSR_PIL 0x00000f00 /* processor interrupt level */ 25#define PSR_PIL 0x00000f00 /* processor interrupt level */
26#define PSR_EF 0x00001000 /* enable floating point */ 26#define PSR_EF 0x00001000 /* enable floating point */
27#define PSR_EC 0x00002000 /* enable co-processor */ 27#define PSR_EC 0x00002000 /* enable co-processor */
28#define PSR_SYSCALL 0x00004000 /* inside of a syscall */
28#define PSR_LE 0x00008000 /* SuperSparcII little-endian */ 29#define PSR_LE 0x00008000 /* SuperSparcII little-endian */
29#define PSR_ICC 0x00f00000 /* integer condition codes */ 30#define PSR_ICC 0x00f00000 /* integer condition codes */
30#define PSR_C 0x00100000 /* carry bit */ 31#define PSR_C 0x00100000 /* carry bit */
diff --git a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h
index 8201a7b29d49..0afb867d6c1b 100644
--- a/include/asm-sparc/ptrace.h
+++ b/include/asm-sparc/ptrace.h
@@ -10,6 +10,8 @@
10 10
11#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
12 12
13#include <linux/types.h>
14
13struct pt_regs { 15struct pt_regs {
14 unsigned long psr; 16 unsigned long psr;
15 unsigned long pc; 17 unsigned long pc;
@@ -39,6 +41,16 @@ struct pt_regs {
39#define UREG_FP UREG_I6 41#define UREG_FP UREG_I6
40#define UREG_RETPC UREG_I7 42#define UREG_RETPC UREG_I7
41 43
44static inline bool pt_regs_is_syscall(struct pt_regs *regs)
45{
46 return (regs->psr & PSR_SYSCALL);
47}
48
49static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
50{
51 return (regs->psr &= ~PSR_SYSCALL);
52}
53
42/* A register window */ 54/* A register window */
43struct reg_window { 55struct reg_window {
44 unsigned long locals[8]; 56 unsigned long locals[8];
@@ -149,6 +161,7 @@ extern void show_regs(struct pt_regs *);
149#define SF_XXARG 0x5c 161#define SF_XXARG 0x5c
150 162
151/* Stuff for the ptrace system call */ 163/* Stuff for the ptrace system call */
164#define PTRACE_SPARC_DETACH 11
152#define PTRACE_GETREGS 12 165#define PTRACE_GETREGS 12
153#define PTRACE_SETREGS 13 166#define PTRACE_SETREGS 13
154#define PTRACE_GETFPREGS 14 167#define PTRACE_GETFPREGS 14
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index d03a21c97abb..94071c75701f 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -199,13 +199,7 @@ typedef struct sigaltstack {
199 size_t ss_size; 199 size_t ss_size;
200} stack_t; 200} stack_t;
201 201
202struct sparc_deliver_cookie { 202#define ptrace_signal_deliver(regs, cookie) do { } while (0)
203 int restart_syscall;
204 unsigned long orig_i0;
205};
206
207struct pt_regs;
208extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
209 203
210#endif /* !(__KERNEL__) */ 204#endif /* !(__KERNEL__) */
211 205
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h
index b3f492208fd2..e6d561599726 100644
--- a/include/asm-sparc/smp.h
+++ b/include/asm-sparc/smp.h
@@ -51,13 +51,11 @@ void smp_bogo(struct seq_file *);
51void smp_info(struct seq_file *); 51void smp_info(struct seq_file *);
52 52
53BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) 53BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)
54BTFIXUPDEF_CALL(void, smp_message_pass, int, int, unsigned long, int)
55BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) 54BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void)
56BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) 55BTFIXUPDEF_BLACKBOX(hard_smp_processor_id)
57BTFIXUPDEF_BLACKBOX(load_current) 56BTFIXUPDEF_BLACKBOX(load_current)
58 57
59#define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) 58#define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5)
60#define smp_message_pass(target,msg,data,wait) BTFIXUP_CALL(smp_message_pass)(target,msg,data,wait)
61 59
62static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } 60static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); }
63static inline void xc1(smpfunc_t func, unsigned long arg1) 61static inline void xc1(smpfunc_t func, unsigned long arg1)
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 4e08210cd4c2..b4b024445fc9 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -94,6 +94,8 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
94 } while(0) 94 } while(0)
95#endif 95#endif
96 96
97extern void flushw_all(void);
98
97/* 99/*
98 * Flush windows so that the VM switch which follows 100 * Flush windows so that the VM switch which follows
99 * would not pull the stack from under us. 101 * would not pull the stack from under us.
diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h
index 42fc6ed98156..1b08ef860a66 100644
--- a/include/asm-sparc/types.h
+++ b/include/asm-sparc/types.h
@@ -3,34 +3,18 @@
3#define _SPARC_TYPES_H 3#define _SPARC_TYPES_H
4 4
5/* 5/*
6 * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
7 * header files exported to user space.
8 */
9
10/*
11 * This file is never included by application software unless 6 * This file is never included by application software unless
12 * explicitly requested (e.g., via linux/types.h) in which case the 7 * explicitly requested (e.g., via linux/types.h) in which case the
13 * application is Linux specific so (user-) name space pollution is 8 * application is Linux specific so (user-) name space pollution is
14 * not a major issue. However, for interoperability, libraries still 9 * not a major issue. However, for interoperability, libraries still
15 * need to be careful to avoid a name clashes. 10 * need to be careful to avoid a name clashes.
16 */ 11 */
12#include <asm-generic/int-ll64.h>
17 13
18#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
19 15
20typedef unsigned short umode_t; 16typedef unsigned short umode_t;
21 17
22typedef __signed__ char __s8;
23typedef unsigned char __u8;
24
25typedef __signed__ short __s16;
26typedef unsigned short __u16;
27
28typedef __signed__ int __s32;
29typedef unsigned int __u32;
30
31typedef __signed__ long long __s64;
32typedef unsigned long long __u64;
33
34#endif /* __ASSEMBLY__ */ 18#endif /* __ASSEMBLY__ */
35 19
36#ifdef __KERNEL__ 20#ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned long long __u64;
39 23
40#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
41 25
42typedef __signed__ char s8;
43typedef unsigned char u8;
44
45typedef __signed__ short s16;
46typedef unsigned short u16;
47
48typedef __signed__ int s32;
49typedef unsigned int u32;
50
51typedef __signed__ long long s64;
52typedef unsigned long long u64;
53
54typedef u32 dma_addr_t; 26typedef u32 dma_addr_t;
55typedef u32 dma64_addr_t; 27typedef u32 dma64_addr_t;
56 28
diff --git a/include/asm-sparc/unaligned.h b/include/asm-sparc/unaligned.h
index b6f8eddd30af..11d2d5fb5902 100644
--- a/include/asm-sparc/unaligned.h
+++ b/include/asm-sparc/unaligned.h
@@ -1,6 +1,10 @@
1#ifndef _ASM_SPARC_UNALIGNED_H_ 1#ifndef _ASM_SPARC_UNALIGNED_H
2#define _ASM_SPARC_UNALIGNED_H_ 2#define _ASM_SPARC_UNALIGNED_H
3 3
4#include <asm-generic/unaligned.h> 4#include <linux/unaligned/be_struct.h>
5#include <linux/unaligned/le_byteshift.h>
6#include <linux/unaligned/generic.h>
7#define get_unaligned __get_unaligned_be
8#define put_unaligned __put_unaligned_be
5 9
6#endif /* _ASM_SPARC_UNALIGNED_H */ 10#endif /* _ASM_SPARC_UNALIGNED_H */