Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Removes references to cast module. #40

Merged
merged 1 commit into from
May 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hal/cortex_m3/isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static ISRCount: uint = 16;

#[link_section=".isr_vector"]
#[no_mangle]
pub static ISRVectors: [Option<extern unsafe fn()>, ..ISRCount] = [
pub static ISRVectors: [Option<unsafe extern fn()>, ..ISRCount] = [
Some(__STACK_BASE),
Some(main), // Reset
Some(isr_nmi), // NMI
Expand Down
2 changes: 1 addition & 1 deletion src/hal/lpc17xx/isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static ISRCount: uint = 35;

#[link_section=".isr_vector_nvic"]
#[no_mangle]
pub static NVICVectors: [Option<extern unsafe fn()>, ..ISRCount] = [
pub static NVICVectors: [Option<unsafe extern fn()>, ..ISRCount] = [
// s.a. lpc17xx user manual, table 50 (chapter 6.3)
Some(isr_wdt),
Some(isr_timer_0),
Expand Down
5 changes: 3 additions & 2 deletions src/lib/volatile_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

use core::kinds::marker;
use core::intrinsics::{volatile_load, volatile_store};
use core::cast::transmute_mut_unsafe;

// TODO(bharrisau) I don't know enough about markers - is it better
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farcaller Any suggestions here?

// to just use an Unsafe<T> here instead?
pub struct VolatileCell<T> {
value: T,
invariant: marker::InvariantType<T>,
Expand All @@ -42,7 +43,7 @@ impl<T> VolatileCell<T> {
#[inline]
pub fn set(&self, value: T) {
unsafe {
volatile_store(&mut (*transmute_mut_unsafe(&self.value)), value)
volatile_store(&self.value as *T as *mut T, value)
}
}
}
3 changes: 1 addition & 2 deletions src/os/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

//! debug::port provides interface to output structured data over serial port.

use core::mem::size_of;
use core::cast::transmute;
use core::mem::{size_of, transmute};
use core::intrinsics::abort;

use drivers::chario::CharIO;
Expand Down