diff options
| author | bors <bors@rust-lang.org> | 2017-01-19 18:32:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-01-19 18:32:12 +0000 |
| commit | 8e29b4d3876fc141a0c451c65045bda2c1f39534 (patch) | |
| tree | ff288889fb694407db09c1a0f87d50f12ab3269d /src/rustllvm/RustWrapper.cpp | |
| parent | 47965f51e6d91ae33bf2b0da0f5510f03766feac (diff) | |
| parent | e928c7584769fe4d445862d05928486e49d5b505 (diff) | |
| download | rust-8e29b4d3876fc141a0c451c65045bda2c1f39534.tar.gz rust-8e29b4d3876fc141a0c451c65045bda2c1f39534.zip | |
Auto merge of #38465 - japaric:msp430-interrupt, r=eddyb
calling convention for MSP430 interrupts
This calling convention is used to define interrup handlers on MSP430 microcontrollers. Usage looks like this:
``` rust
#[no_mangle]
#[link_section = "__interrupt_vector_10"]
pub static TIM0_VECTOR: unsafe extern "msp430-interrupt" fn() = tim0;
unsafe extern "msp430-interrupt" fn tim0() {
P1OUT.write(0x00);
}
```
which generates the following assembly:
``` asm
Disassembly of section __interrupt_vector_10:
0000fff2 <TIM0_VECTOR>:
fff2: 10 c0 interrupt service routine at 0xc010
Disassembly of section .text:
0000c010 <_ZN3msp4tim017h3193b957fd6a4fd4E>:
c010: c2 43 21 00 mov.b #0, &0x0021 ;r3 As==00
c014: 00 13 reti
...
```
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
