diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2016-12-18 23:45:20 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2017-01-18 20:42:54 -0500 |
| commit | 6296d52ba60771232ab362c116e898aa930679ad (patch) | |
| tree | bde28fc4dc6e797d393d9830b39efd2c891c1a81 /src/test/run-pass/thinlto | |
| parent | c8af93f0901c336e873ce18274026d0fd9bc7c1f (diff) | |
| download | rust-6296d52ba60771232ab362c116e898aa930679ad.tar.gz rust-6296d52ba60771232ab362c116e898aa930679ad.zip | |
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/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
