-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 58835 b: refs/heads/master c: 7adfb58 h: refs/heads/master i: 58833: ee13eca 58831: 0c0854b v: v3
- Loading branch information
Bernd Schmidt
authored and
Bryan Wu
committed
Jun 21, 2007
1 parent
6b4b6ca
commit d0b4a38
Showing
10 changed files
with
262 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 0ba9e350a2c129ce2878d415cf51e88611cbc0e5 | ||
refs/heads/master: 7adfb58fbd0a27469d26536f99b66391c4c8e2a0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/* | ||
* This file contains sequences of code that will be copied to a | ||
* fixed location, defined in <asm/atomic_seq.h>. The interrupt | ||
* handlers ensure that these sequences appear to be atomic when | ||
* executed from userspace. | ||
* These are aligned to 16 bytes, so that we have some space to replace | ||
* these sequences with something else (e.g. kernel traps if we ever do | ||
* BF561 SMP). | ||
*/ | ||
#include <linux/linkage.h> | ||
#include <asm/entry.h> | ||
#include <asm/unistd.h> | ||
|
||
.text | ||
ENTRY(_fixed_code_start) | ||
|
||
.align 16 | ||
ENTRY(_sigreturn_stub) | ||
P0 = __NR_rt_sigreturn; | ||
EXCPT 0; | ||
/* Speculative execution paranoia. */ | ||
0: JUMP.S 0b; | ||
ENDPROC (_sigreturn_stub) | ||
|
||
.align 16 | ||
/* | ||
* Atomic swap, 8 bit. | ||
* Inputs: P0: memory address to use | ||
* R1: value to store | ||
* Output: R0: old contents of the memory address, zero extended. | ||
*/ | ||
ENTRY(_atomic_xchg32) | ||
R0 = [P0]; | ||
[P0] = R1; | ||
rts; | ||
ENDPROC (_atomic_xchg32) | ||
|
||
.align 16 | ||
/* | ||
* Compare and swap, 32 bit. | ||
* Inputs: P0: memory address to use | ||
* R1: compare value | ||
* R2: new value to store | ||
* The new value is stored if the contents of the memory | ||
* address is equal to the compare value. | ||
* Output: R0: old contents of the memory address. | ||
*/ | ||
ENTRY(_atomic_cas32) | ||
R0 = [P0]; | ||
CC = R0 == R1; | ||
IF !CC JUMP 1f; | ||
[P0] = R2; | ||
1: | ||
rts; | ||
ENDPROC (_atomic_cas32) | ||
|
||
.align 16 | ||
/* | ||
* Atomic add, 32 bit. | ||
* Inputs: P0: memory address to use | ||
* R0: value to add | ||
* Outputs: R0: new contents of the memory address. | ||
* R1: previous contents of the memory address. | ||
*/ | ||
ENTRY(_atomic_add32) | ||
R1 = [P0]; | ||
R0 = R1 + R0; | ||
[P0] = R0; | ||
rts; | ||
ENDPROC (_atomic_add32) | ||
|
||
.align 16 | ||
/* | ||
* Atomic sub, 32 bit. | ||
* Inputs: P0: memory address to use | ||
* R0: value to subtract | ||
* Outputs: R0: new contents of the memory address. | ||
* R1: previous contents of the memory address. | ||
*/ | ||
ENTRY(_atomic_sub32) | ||
R1 = [P0]; | ||
R0 = R1 - R0; | ||
[P0] = R0; | ||
rts; | ||
ENDPROC (_atomic_sub32) | ||
|
||
.align 16 | ||
/* | ||
* Atomic ior, 32 bit. | ||
* Inputs: P0: memory address to use | ||
* R0: value to ior | ||
* Outputs: R0: new contents of the memory address. | ||
* R1: previous contents of the memory address. | ||
*/ | ||
ENTRY(_atomic_ior32) | ||
R1 = [P0]; | ||
R0 = R1 | R0; | ||
[P0] = R0; | ||
rts; | ||
ENDPROC (_atomic_ior32) | ||
|
||
.align 16 | ||
/* | ||
* Atomic ior, 32 bit. | ||
* Inputs: P0: memory address to use | ||
* R0: value to ior | ||
* Outputs: R0: new contents of the memory address. | ||
* R1: previous contents of the memory address. | ||
*/ | ||
ENTRY(_atomic_and32) | ||
R1 = [P0]; | ||
R0 = R1 & R0; | ||
[P0] = R0; | ||
rts; | ||
ENDPROC (_atomic_ior32) | ||
|
||
.align 16 | ||
/* | ||
* Atomic ior, 32 bit. | ||
* Inputs: P0: memory address to use | ||
* R0: value to ior | ||
* Outputs: R0: new contents of the memory address. | ||
* R1: previous contents of the memory address. | ||
*/ | ||
ENTRY(_atomic_xor32) | ||
R1 = [P0]; | ||
R0 = R1 ^ R0; | ||
[P0] = R0; | ||
rts; | ||
ENDPROC (_atomic_ior32) | ||
|
||
ENTRY(_fixed_code_end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
include include/asm-generic/Kbuild.asm | ||
|
||
header-y += fixed_code.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* This file defines the fixed addresses where userspace programs can find | ||
atomic code sequences. */ | ||
|
||
#define FIXED_CODE_START 0x400 | ||
|
||
#define SIGRETURN_STUB 0x400 | ||
|
||
#define ATOMIC_SEQS_START 0x410 | ||
|
||
#define ATOMIC_XCHG32 0x410 | ||
#define ATOMIC_CAS32 0x420 | ||
#define ATOMIC_ADD32 0x430 | ||
#define ATOMIC_SUB32 0x440 | ||
#define ATOMIC_IOR32 0x450 | ||
#define ATOMIC_AND32 0x460 | ||
#define ATOMIC_XOR32 0x470 | ||
|
||
#define ATOMIC_SEQS_END 0x480 | ||
|
||
#define FIXED_CODE_END 0x480 |