diff options
author | Pixel <pixel@nobis-crew.org> | 2011-01-30 00:53:28 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-01-30 00:53:28 -0800 |
commit | 29dc401e5ba2c3f5676d426c4c1b10f1fc475fcd (patch) | |
tree | 62118aa85c15dad2a25739d33fc86362ccf4c576 /arch | |
parent | 7866fb9a517492a01dfe39fadc8f32992f31a842 (diff) |
Added semihosting support.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/angel.h | 11 | ||||
-rw-r--r-- | arch/arm/src/angel.s | 65 |
2 files changed, 76 insertions, 0 deletions
diff --git a/arch/arm/include/angel.h b/arch/arm/include/angel.h new file mode 100644 index 0000000..3b9456a --- /dev/null +++ b/arch/arm/include/angel.h @@ -0,0 +1,11 @@ +#ifndef __ANGEL_H__ +#define __ANGEL_H__ + +int Semihost_SYS_OPEN(uint32_t * args); +int Semihost_SYS_CLOSE(uint32_t * args); +int Semihost_SYS_WRITE(uint32_t * args); +int Semihost_SYS_READ(uint32_t * args); +int Semihost_SYS_SEEK(uint32_t * args); +int Semihost_SYS_FLEN(uint32_t * args); + +#endif diff --git a/arch/arm/src/angel.s b/arch/arm/src/angel.s new file mode 100644 index 0000000..3a0e4c6 --- /dev/null +++ b/arch/arm/src/angel.s @@ -0,0 +1,65 @@ +.cpu cortex-m3 +.syntax unified +.thumb + +.section ".text.Semihost_SYS_OPEN", "x", %progbits +.thumb_func +.globl Semihost_SYS_OPEN +.type Semihost_SYS_OPEN, %function +Semihost_SYS_OPEN: + mov r1, r0 + mov r0, #1 + bkpt 0xAB + bx lr + +.section ".text.Semihost_SYS_CLOSE", "x", %progbits +.thumb_func +.globl Semihost_SYS_CLOSE +.type Semihost_SYS_CLOSE, %function +Semihost_SYS_CLOSE: + mov r1, r0 + mov r0, #2 + bkpt 0xAB + bx lr + +.section ".text.Semihost_SYS_WRITE", "x", %progbits +.thumb_func +.globl Semihost_SYS_WRITE +.type Semihost_SYS_WRITE, %function +Semihost_SYS_WRITE: + mov r1, r0 + mov r0, #5 + bkpt 0xAB + bx lr + +.section ".text.Semihost_SYS_READ", "x", %progbits +.thumb_func +.globl Semihost_SYS_READ +.type Semihost_SYS_READ, %function +Semihost_SYS_READ: + mov r1, r0 + mov r0, #6 + bkpt 0xAB + bx lr + +.section ".text.Semihost_SYS_SEEK", "x", %progbits +.thumb_func +.globl Semihost_SYS_SEEK +.type Semihost_SYS_SEEK, %function +Semihost_SYS_SEEK: + mov r1, r0 + mov r0, #10 + bkpt 0xAB + bx lr + +.section ".text.Semihost_SYS_FLEN", "x", %progbits +.thumb_func +.globl Semihost_SYS_FLEN +.type Semihost_SYS_FLEN, %function +Semihost_SYS_FLEN: + mov r1, r0 + mov r0, #12 + bkpt 0xAB + bx lr + +.end |