forked from M-Labs/artiq
firmware: suppress warning
This commit is contained in:
parent
1da0554a49
commit
eecd825d23
|
@ -47,7 +47,7 @@ fn memory_test(total: &mut usize, wrong: &mut usize) -> bool {
|
||||||
MEMORY[$index:expr] = $data:expr
|
MEMORY[$index:expr] = $data:expr
|
||||||
}
|
}
|
||||||
) => ({
|
) => ({
|
||||||
$prepare;
|
$prepare
|
||||||
for $i in $range {
|
for $i in $range {
|
||||||
unsafe { ptr::write_volatile(MEMORY.offset($index as isize), $data) };
|
unsafe { ptr::write_volatile(MEMORY.offset($index as isize), $data) };
|
||||||
*total += 1;
|
*total += 1;
|
||||||
|
@ -56,7 +56,7 @@ fn memory_test(total: &mut usize, wrong: &mut usize) -> bool {
|
||||||
cache::flush_cpu_dcache();
|
cache::flush_cpu_dcache();
|
||||||
cache::flush_l2_cache();
|
cache::flush_l2_cache();
|
||||||
|
|
||||||
$prepare;
|
$prepare
|
||||||
for $i in $range {
|
for $i in $range {
|
||||||
if unsafe { ptr::read_volatile(MEMORY.offset($index as isize)) } != $data {
|
if unsafe { ptr::read_volatile(MEMORY.offset($index as isize)) } != $data {
|
||||||
*wrong += 1;
|
*wrong += 1;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
#![allow(private_no_mangle_fns, non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
|
||||||
use core::{ptr, mem};
|
use core::{ptr, mem};
|
||||||
use cslice::CSlice;
|
use cslice::CSlice;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#![feature(lang_items, llvm_asm, panic_unwind, libc, unwind_attributes,
|
#![feature(lang_items, llvm_asm, panic_unwind, libc, unwind_attributes,
|
||||||
panic_handler, panic_info_message, nll)]
|
panic_info_message, nll)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
@ -204,7 +204,6 @@ fn terminate(exception: &eh_artiq::Exception, backtrace: &mut [usize]) -> ! {
|
||||||
|
|
||||||
#[unwind(aborts)]
|
#[unwind(aborts)]
|
||||||
extern fn cache_get<'a>(ret: &'a mut CSlice<i32>, key: &CSlice<u8>) -> &'a CSlice<'a, i32> {
|
extern fn cache_get<'a>(ret: &'a mut CSlice<i32>, key: &CSlice<u8>) -> &'a CSlice<'a, i32> {
|
||||||
unsafe {
|
|
||||||
send(&CacheGetRequest {
|
send(&CacheGetRequest {
|
||||||
key: str::from_utf8(key.as_ref()).unwrap()
|
key: str::from_utf8(key.as_ref()).unwrap()
|
||||||
});
|
});
|
||||||
|
@ -213,7 +212,6 @@ extern fn cache_get<'a>(ret: &'a mut CSlice<i32>, key: &CSlice<u8>) -> &'a CSlic
|
||||||
ret
|
ret
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[unwind(allowed)]
|
#[unwind(allowed)]
|
||||||
extern fn cache_put(key: &CSlice<u8>, list: &CSlice<i32>) {
|
extern fn cache_put(key: &CSlice<u8>, list: &CSlice<i32>) {
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
#![feature(asm, lang_items, never_type)]
|
#![feature(lang_items, never_type)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
extern crate failure;
|
extern crate failure;
|
||||||
#[cfg(has_drtio)]
|
#[cfg(has_drtio)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate failure_derive;
|
extern crate failure_derive;
|
||||||
#[macro_use]
|
|
||||||
extern crate bitflags;
|
|
||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
extern crate crc;
|
extern crate crc;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -77,10 +77,10 @@ mod imp {
|
||||||
|
|
||||||
mod lock {
|
mod lock {
|
||||||
use core::slice;
|
use core::slice;
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
|
use core::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use super::Error;
|
use super::Error;
|
||||||
|
|
||||||
static LOCKED: AtomicUsize = ATOMIC_USIZE_INIT;
|
static LOCKED: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
pub struct Lock;
|
pub struct Lock;
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ mod imp {
|
||||||
let mut offset = 0;
|
let mut offset = 0;
|
||||||
let mut iter = Iter::new(old_data);
|
let mut iter = Iter::new(old_data);
|
||||||
'iter: while let Some(result) = iter.next() {
|
'iter: while let Some(result) = iter.next() {
|
||||||
let (key, mut value) = result?;
|
let (key, value) = result?;
|
||||||
if value.is_empty() {
|
if value.is_empty() {
|
||||||
// This is a removed entry, ignore it.
|
// This is a removed entry, ignore it.
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -31,7 +31,7 @@ mod ddr {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(ddrphy_wlevel)]
|
#[cfg(ddrphy_wlevel)]
|
||||||
unsafe fn write_level_scan(logger: &mut Option<&mut fmt::Write>) {
|
unsafe fn write_level_scan(logger: &mut Option<&mut dyn fmt::Write>) {
|
||||||
#[cfg(kusddrphy)]
|
#[cfg(kusddrphy)]
|
||||||
log!(logger, "DQS initial delay: {} taps\n", ddrphy::wdly_dqs_taps_read());
|
log!(logger, "DQS initial delay: {} taps\n", ddrphy::wdly_dqs_taps_read());
|
||||||
log!(logger, "Write leveling scan:\n");
|
log!(logger, "Write leveling scan:\n");
|
||||||
|
@ -82,7 +82,7 @@ mod ddr {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(ddrphy_wlevel)]
|
#[cfg(ddrphy_wlevel)]
|
||||||
unsafe fn write_level(logger: &mut Option<&mut fmt::Write>,
|
unsafe fn write_level(logger: &mut Option<&mut dyn fmt::Write>,
|
||||||
delay: &mut [u16; DQS_SIGNAL_COUNT],
|
delay: &mut [u16; DQS_SIGNAL_COUNT],
|
||||||
high_skew: &mut [bool; DQS_SIGNAL_COUNT]) -> bool {
|
high_skew: &mut [bool; DQS_SIGNAL_COUNT]) -> bool {
|
||||||
#[cfg(kusddrphy)]
|
#[cfg(kusddrphy)]
|
||||||
|
@ -172,7 +172,7 @@ mod ddr {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(ddrphy_wlevel)]
|
#[cfg(ddrphy_wlevel)]
|
||||||
unsafe fn read_bitslip(logger: &mut Option<&mut fmt::Write>,
|
unsafe fn read_bitslip(logger: &mut Option<&mut dyn fmt::Write>,
|
||||||
delay: &[u16; DQS_SIGNAL_COUNT],
|
delay: &[u16; DQS_SIGNAL_COUNT],
|
||||||
high_skew: &[bool; DQS_SIGNAL_COUNT]) {
|
high_skew: &[bool; DQS_SIGNAL_COUNT]) {
|
||||||
let threshold_opt = delay.iter().zip(high_skew.iter())
|
let threshold_opt = delay.iter().zip(high_skew.iter())
|
||||||
|
@ -203,7 +203,7 @@ mod ddr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn read_level_scan(logger: &mut Option<&mut fmt::Write>) {
|
unsafe fn read_level_scan(logger: &mut Option<&mut dyn fmt::Write>) {
|
||||||
log!(logger, "Read leveling scan:\n");
|
log!(logger, "Read leveling scan:\n");
|
||||||
|
|
||||||
// Generate pseudo-random sequence
|
// Generate pseudo-random sequence
|
||||||
|
@ -286,7 +286,7 @@ mod ddr {
|
||||||
spin_cycles(15);
|
spin_cycles(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn read_level(logger: &mut Option<&mut fmt::Write>) -> bool {
|
unsafe fn read_level(logger: &mut Option<&mut dyn fmt::Write>) -> bool {
|
||||||
log!(logger, "Read leveling: ");
|
log!(logger, "Read leveling: ");
|
||||||
|
|
||||||
// Generate pseudo-random sequence
|
// Generate pseudo-random sequence
|
||||||
|
@ -417,7 +417,7 @@ mod ddr {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn level(logger: &mut Option<&mut fmt::Write>) -> bool {
|
pub unsafe fn level(logger: &mut Option<&mut dyn fmt::Write>) -> bool {
|
||||||
#[cfg(ddrphy_wlevel)]
|
#[cfg(ddrphy_wlevel)]
|
||||||
{
|
{
|
||||||
let mut delay = [0; DQS_SIGNAL_COUNT];
|
let mut delay = [0; DQS_SIGNAL_COUNT];
|
||||||
|
@ -442,7 +442,7 @@ use core::fmt;
|
||||||
use csr;
|
use csr;
|
||||||
use sdram_phy;
|
use sdram_phy;
|
||||||
|
|
||||||
pub unsafe fn init(mut _logger: Option<&mut fmt::Write>) -> bool {
|
pub unsafe fn init(mut _logger: Option<&mut dyn fmt::Write>) -> bool {
|
||||||
sdram_phy::initialize();
|
sdram_phy::initialize();
|
||||||
|
|
||||||
#[cfg(has_ddrphy)]
|
#[cfg(has_ddrphy)]
|
||||||
|
|
|
@ -159,7 +159,7 @@ impl<'a> Library<'a> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn resolve_rela(&self, rela: &Elf32_Rela, resolve: &Fn(&[u8]) -> Option<Elf32_Word>)
|
fn resolve_rela(&self, rela: &Elf32_Rela, resolve: &dyn Fn(&[u8]) -> Option<Elf32_Word>)
|
||||||
-> Result<(), Error<'a>> {
|
-> Result<(), Error<'a>> {
|
||||||
let sym;
|
let sym;
|
||||||
if ELF32_R_SYM(rela.r_info) == 0 {
|
if ELF32_R_SYM(rela.r_info) == 0 {
|
||||||
|
@ -204,7 +204,7 @@ impl<'a> Library<'a> {
|
||||||
self.update_rela(rela, value)
|
self.update_rela(rela, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load(data: &[u8], image: &'a mut [u8], resolve: &Fn(&[u8]) -> Option<Elf32_Word>)
|
pub fn load(data: &[u8], image: &'a mut [u8], resolve: &dyn Fn(&[u8]) -> Option<Elf32_Word>)
|
||||||
-> Result<Library<'a>, Error<'a>> {
|
-> Result<Library<'a>, Error<'a>> {
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,8 @@
|
||||||
//
|
//
|
||||||
// By design, this personality function is only ever called in the search phase, although
|
// By design, this personality function is only ever called in the search phase, although
|
||||||
// to keep things simple and close to upstream, it is not modified
|
// to keep things simple and close to upstream, it is not modified
|
||||||
#![allow(private_no_mangle_fns)]
|
|
||||||
|
|
||||||
use unwind as uw;
|
use unwind as uw;
|
||||||
use libc::{c_int, uintptr_t};
|
use libc::{c_int, uintptr_t};
|
||||||
use cslice::AsCSlice;
|
|
||||||
|
|
||||||
use dwarf::{self, EHAction, EHContext};
|
use dwarf::{self, EHAction, EHContext};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![cfg_attr(feature = "alloc", feature(alloc))]
|
|
||||||
|
|
||||||
extern crate failure;
|
extern crate failure;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![cfg_attr(feature = "alloc", feature(alloc))]
|
|
||||||
|
|
||||||
extern crate failure;
|
extern crate failure;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -18,7 +18,7 @@ unsafe fn align_ptr_mut<T>(ptr: *mut ()) -> *mut T {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn recv_value<R, E>(reader: &mut R, tag: Tag, data: &mut *mut (),
|
unsafe fn recv_value<R, E>(reader: &mut R, tag: Tag, data: &mut *mut (),
|
||||||
alloc: &Fn(usize) -> Result<*mut (), E>)
|
alloc: &dyn Fn(usize) -> Result<*mut (), E>)
|
||||||
-> Result<(), E>
|
-> Result<(), E>
|
||||||
where R: Read + ?Sized,
|
where R: Read + ?Sized,
|
||||||
E: From<Error<R::ReadError>>
|
E: From<Error<R::ReadError>>
|
||||||
|
@ -63,7 +63,7 @@ unsafe fn recv_value<R, E>(reader: &mut R, tag: Tag, data: &mut *mut (),
|
||||||
}
|
}
|
||||||
Tag::List(it) => {
|
Tag::List(it) => {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct List { elements: *mut (), length: u32 };
|
struct List { elements: *mut (), length: u32 }
|
||||||
consume_value!(List, |ptr| {
|
consume_value!(List, |ptr| {
|
||||||
(*ptr).length = reader.read_u32()?;
|
(*ptr).length = reader.read_u32()?;
|
||||||
let length = (*ptr).length as usize;
|
let length = (*ptr).length as usize;
|
||||||
|
@ -151,7 +151,7 @@ unsafe fn recv_value<R, E>(reader: &mut R, tag: Tag, data: &mut *mut (),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn recv_return<R, E>(reader: &mut R, tag_bytes: &[u8], data: *mut (),
|
pub fn recv_return<R, E>(reader: &mut R, tag_bytes: &[u8], data: *mut (),
|
||||||
alloc: &Fn(usize) -> Result<*mut (), E>)
|
alloc: &dyn Fn(usize) -> Result<*mut (), E>)
|
||||||
-> Result<(), E>
|
-> Result<(), E>
|
||||||
where R: Read + ?Sized,
|
where R: Read + ?Sized,
|
||||||
E: From<Error<R::ReadError>>
|
E: From<Error<R::ReadError>>
|
||||||
|
@ -208,7 +208,7 @@ unsafe fn send_value<W>(writer: &mut W, tag: Tag, data: &mut *const ())
|
||||||
}
|
}
|
||||||
Tag::List(it) => {
|
Tag::List(it) => {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct List { elements: *const (), length: u32 };
|
struct List { elements: *const (), length: u32 }
|
||||||
consume_value!(List, |ptr| {
|
consume_value!(List, |ptr| {
|
||||||
let length = (*ptr).length as usize;
|
let length = (*ptr).length as usize;
|
||||||
writer.write_u32((*ptr).length)?;
|
writer.write_u32((*ptr).length)?;
|
||||||
|
@ -287,7 +287,7 @@ unsafe fn send_value<W>(writer: &mut W, tag: Tag, data: &mut *const ())
|
||||||
}
|
}
|
||||||
Tag::Keyword(it) => {
|
Tag::Keyword(it) => {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct Keyword<'a> { name: CSlice<'a, u8> };
|
struct Keyword<'a> { name: CSlice<'a, u8> }
|
||||||
consume_value!(Keyword, |ptr| {
|
consume_value!(Keyword, |ptr| {
|
||||||
writer.write_string(str::from_utf8((*ptr).name.as_ref()).unwrap())?;
|
writer.write_string(str::from_utf8((*ptr).name.as_ref()).unwrap())?;
|
||||||
let tag = it.clone().next().expect("truncated tag");
|
let tag = it.clone().next().expect("truncated tag");
|
||||||
|
@ -299,7 +299,7 @@ unsafe fn send_value<W>(writer: &mut W, tag: Tag, data: &mut *const ())
|
||||||
}
|
}
|
||||||
Tag::Object => {
|
Tag::Object => {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct Object { id: u32 };
|
struct Object { id: u32 }
|
||||||
consume_value!(*const Object, |ptr|
|
consume_value!(*const Object, |ptr|
|
||||||
writer.write_u32((**ptr).id))
|
writer.write_u32((**ptr).id))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![feature(lang_items, alloc, try_from, nonzero, asm,
|
#![feature(lang_items, panic_info_message)]
|
||||||
panic_handler, panic_info_message)]
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
extern crate eh;
|
extern crate eh;
|
||||||
|
@ -280,7 +279,6 @@ pub struct TrapFrame {
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern fn exception(regs: *const TrapFrame) {
|
pub extern fn exception(regs: *const TrapFrame) {
|
||||||
unsafe {
|
|
||||||
let pc = mepc::read();
|
let pc = mepc::read();
|
||||||
let cause = mcause::read().cause();
|
let cause = mcause::read().cause();
|
||||||
match cause {
|
match cause {
|
||||||
|
@ -308,7 +306,6 @@ pub extern fn exception(regs: *const TrapFrame) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern fn abort() {
|
pub extern fn abort() {
|
||||||
|
|
|
@ -35,7 +35,7 @@ type SocketSet = ::smoltcp::socket::SocketSet<'static, 'static, 'static>;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct WaitRequest {
|
struct WaitRequest {
|
||||||
event: Option<*mut FnMut() -> bool>,
|
event: Option<*mut dyn FnMut() -> bool>,
|
||||||
timeout: Option<u64>
|
timeout: Option<u64>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ impl<'a> Io<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn until<F: FnMut() -> bool>(&self, mut f: F) -> Result<(), Error> {
|
pub fn until<F: FnMut() -> bool>(&self, mut f: F) -> Result<(), Error> {
|
||||||
let f = unsafe { mem::transmute::<&mut FnMut() -> bool, *mut FnMut() -> bool>(&mut f) };
|
let f = unsafe { mem::transmute::<&mut dyn FnMut() -> bool, *mut dyn FnMut() -> bool>(&mut f) };
|
||||||
self.suspend(WaitRequest {
|
self.suspend(WaitRequest {
|
||||||
timeout: None,
|
timeout: None,
|
||||||
event: Some(f)
|
event: Some(f)
|
||||||
|
|
|
@ -539,7 +539,7 @@ pub extern fn main() -> i32 {
|
||||||
}
|
}
|
||||||
while !drtiosat_link_rx_up() {
|
while !drtiosat_link_rx_up() {
|
||||||
drtiosat_process_errors();
|
drtiosat_process_errors();
|
||||||
for mut rep in repeaters.iter_mut() {
|
for rep in repeaters.iter_mut() {
|
||||||
rep.service(&routing_table, rank);
|
rep.service(&routing_table, rank);
|
||||||
}
|
}
|
||||||
#[cfg(all(soc_platform = "kasli", hw_rev = "v2.0"))]
|
#[cfg(all(soc_platform = "kasli", hw_rev = "v2.0"))]
|
||||||
|
@ -568,7 +568,7 @@ pub extern fn main() -> i32 {
|
||||||
while drtiosat_link_rx_up() {
|
while drtiosat_link_rx_up() {
|
||||||
drtiosat_process_errors();
|
drtiosat_process_errors();
|
||||||
process_aux_packets(&mut repeaters, &mut routing_table, &mut rank);
|
process_aux_packets(&mut repeaters, &mut routing_table, &mut rank);
|
||||||
for mut rep in repeaters.iter_mut() {
|
for rep in repeaters.iter_mut() {
|
||||||
rep.service(&routing_table, rank);
|
rep.service(&routing_table, rank);
|
||||||
}
|
}
|
||||||
#[cfg(all(soc_platform = "kasli", hw_rev = "v2.0"))]
|
#[cfg(all(soc_platform = "kasli", hw_rev = "v2.0"))]
|
||||||
|
|
Loading…
Reference in New Issue