-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve MSP430 support. - Use the correct number of registers. - Add support for CPUX variant (20-bit registers) * Fix tests and cleanup comments * Use fixed RegId type for msp430
- Loading branch information
Showing
3 changed files
with
87 additions
and
47 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,26 +1,33 @@ | ||
//! Implementations for the TI-MSP430 family of MCUs. | ||
|
||
use gdbstub::arch::Arch; | ||
use gdbstub::arch::RegId; | ||
|
||
pub mod reg; | ||
|
||
/// Implements `Arch` for standard 16-bit TI-MSP430 MCUs. | ||
/// | ||
/// Check out the [module level docs](gdbstub::arch#whats-with-regidimpl) for | ||
/// more info about the `RegIdImpl` type parameter. | ||
pub enum Msp430<RegIdImpl: RegId = reg::id::Msp430RegId> { | ||
#[doc(hidden)] | ||
_Marker(core::marker::PhantomData<RegIdImpl>), | ||
} | ||
pub struct Msp430 {} | ||
|
||
impl<RegIdImpl: RegId> Arch for Msp430<RegIdImpl> { | ||
impl Arch for Msp430 { | ||
type Usize = u16; | ||
type Registers = reg::Msp430Regs; | ||
type RegId = RegIdImpl; | ||
type Registers = reg::Msp430Regs<u16>; | ||
type RegId = reg::id::Msp430RegId<u16>; | ||
type BreakpointKind = usize; | ||
|
||
fn target_description_xml() -> Option<&'static str> { | ||
Some(r#"<target version="1.0"><architecture>msp430</architecture></target>"#) | ||
} | ||
} | ||
|
||
/// Implements `Arch` for 20-bit TI-MSP430 MCUs (CPUX). | ||
pub struct Msp430X {} | ||
|
||
impl Arch for Msp430X { | ||
type Usize = u32; | ||
type Registers = reg::Msp430Regs<u32>; | ||
type RegId = reg::id::Msp430RegId<u32>; | ||
type BreakpointKind = usize; | ||
|
||
fn target_description_xml() -> Option<&'static str> { | ||
Some(r#"<target version="1.0"><architecture>msp430x</architecture></target>"#) | ||
} | ||
} |
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