diff options
author | Bernd Schmidt <bernd.schmidt@analog.com> | 2007-06-20 23:34:16 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-06-20 23:34:16 -0400 |
commit | 7adfb58fbd0a27469d26536f99b66391c4c8e2a0 (patch) | |
tree | 59e511ac2ddca77fe7c9d51bc6f6c6f0049a313b /include/asm-blackfin | |
parent | 0ba9e350a2c129ce2878d415cf51e88611cbc0e5 (diff) |
Blackfin arch: defines and provides entry points for certain user space functions at fixed addresses
This patch defines (and provides) entry points for certain user space functions
at fixed addresses. The Blackfin has no usable atomic instructions, but we can
ensure that these code sequences appear atomic from a user space point of view
by detecting when we're in the process of executing them during the interrupt
handler return path. This allows much more efficient pthread lock
implementations than the bfin_spinlock syscall we're currently using.
Also provided is a small sys_rt_sigreturn stub which can be used by the signal
handler setup code. The signal.c part will be committed separately.
Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'include/asm-blackfin')
-rw-r--r-- | include/asm-blackfin/Kbuild | 2 | ||||
-rw-r--r-- | include/asm-blackfin/bfin-global.h | 12 | ||||
-rw-r--r-- | include/asm-blackfin/cplbinit.h | 4 | ||||
-rw-r--r-- | include/asm-blackfin/fixed_code.h | 20 |
4 files changed, 36 insertions, 2 deletions
diff --git a/include/asm-blackfin/Kbuild b/include/asm-blackfin/Kbuild index c68e1680da01..71f8fe783258 100644 --- a/include/asm-blackfin/Kbuild +++ b/include/asm-blackfin/Kbuild | |||
@@ -1 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | |||
3 | header-y += fixed_code.h | ||
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h index 57f37ccdcdf1..c4d6cbbf96d4 100644 --- a/include/asm-blackfin/bfin-global.h +++ b/include/asm-blackfin/bfin-global.h | |||
@@ -67,6 +67,18 @@ extern void evt14_softirq(void); | |||
67 | extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); | 67 | extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); |
68 | extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type); | 68 | extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type); |
69 | 69 | ||
70 | extern asmlinkage void finish_atomic_sections (struct pt_regs *regs); | ||
71 | extern char fixed_code_start; | ||
72 | extern char fixed_code_end; | ||
73 | extern int atomic_xchg32(void); | ||
74 | extern int atomic_cas32(void); | ||
75 | extern int atomic_add32(void); | ||
76 | extern int atomic_sub32(void); | ||
77 | extern int atomic_ior32(void); | ||
78 | extern int atomic_and32(void); | ||
79 | extern int atomic_xor32(void); | ||
80 | extern void sigreturn_stub(void); | ||
81 | |||
70 | extern void *l1_data_A_sram_alloc(size_t); | 82 | extern void *l1_data_A_sram_alloc(size_t); |
71 | extern void *l1_data_B_sram_alloc(size_t); | 83 | extern void *l1_data_B_sram_alloc(size_t); |
72 | extern void *l1_inst_sram_alloc(size_t); | 84 | extern void *l1_inst_sram_alloc(size_t); |
diff --git a/include/asm-blackfin/cplbinit.h b/include/asm-blackfin/cplbinit.h index 3bad2d1e6a8c..e14ea397cdbb 100644 --- a/include/asm-blackfin/cplbinit.h +++ b/include/asm-blackfin/cplbinit.h | |||
@@ -101,8 +101,8 @@ struct s_cplb { | |||
101 | static struct cplb_desc cplb_data[] = { | 101 | static struct cplb_desc cplb_data[] = { |
102 | { | 102 | { |
103 | .start = 0, | 103 | .start = 0, |
104 | .end = SIZE_4K, | 104 | .end = SIZE_1K, |
105 | .psize = SIZE_4K, | 105 | .psize = SIZE_1K, |
106 | .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB, | 106 | .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB, |
107 | .i_conf = SDRAM_OOPS, | 107 | .i_conf = SDRAM_OOPS, |
108 | .d_conf = SDRAM_OOPS, | 108 | .d_conf = SDRAM_OOPS, |
diff --git a/include/asm-blackfin/fixed_code.h b/include/asm-blackfin/fixed_code.h new file mode 100644 index 000000000000..e6df84ee1557 --- /dev/null +++ b/include/asm-blackfin/fixed_code.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* This file defines the fixed addresses where userspace programs can find | ||
2 | atomic code sequences. */ | ||
3 | |||
4 | #define FIXED_CODE_START 0x400 | ||
5 | |||
6 | #define SIGRETURN_STUB 0x400 | ||
7 | |||
8 | #define ATOMIC_SEQS_START 0x410 | ||
9 | |||
10 | #define ATOMIC_XCHG32 0x410 | ||
11 | #define ATOMIC_CAS32 0x420 | ||
12 | #define ATOMIC_ADD32 0x430 | ||
13 | #define ATOMIC_SUB32 0x440 | ||
14 | #define ATOMIC_IOR32 0x450 | ||
15 | #define ATOMIC_AND32 0x460 | ||
16 | #define ATOMIC_XOR32 0x470 | ||
17 | |||
18 | #define ATOMIC_SEQS_END 0x480 | ||
19 | |||
20 | #define FIXED_CODE_END 0x480 | ||