Unverified Commit 64d0fc0b authored by Carsten's avatar Carsten Committed by GitHub
Browse files

Merge pull request #303 from zyno42/feature/update-libtapasco-dependencies

Update `libtapasco` dependencies
parents ffc11eef f25a61cf
Pipeline #2546 passed with stages
in 221 minutes and 29 seconds
......@@ -54,9 +54,11 @@ webtalk.*
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# Remove `Cargo.lock` from `.gitignore` if creating an executable, leave it for
# libraries. More information here:
# https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
# So only ignore it for `libtapasco`:
runtime/libtapasco/Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
......
This diff is collapsed.
[package]
name = "libtapasco_svm"
version = "1.0.0"
authors = ["Torben Kalhof kalkhof@esa.tu-darmstadt.de>"]
edition = "2018"
authors = ["Torben Kalkhof <kalkhof@esa.tu-darmstadt.de>"]
edition = "2021"
[profile.release]
opt-level = 3
......@@ -11,6 +11,6 @@ lto = "fat"
[dependencies]
tapasco = { path = "../../../libtapasco" }
snafu = "0.6.6"
snafu = "0.7.0"
log = "0.4.14"
env_logger = "0.9.0"
......@@ -44,10 +44,10 @@ fn run_arrayinit(device: Arc<Device>, arrayinit_id: PEId) -> Result<()> {
// -> wrapping the pointer in the VirtualAddress argument type provides a
// check whether the loaded bitstream actually supports SVM
let arg_vec = vec![PEParameter::VirtualAddress(v_boxed.as_ptr())];
let mut pe = device.acquire_pe(arrayinit_id).context(DeviceInit {})?;
pe.start(arg_vec).context(JobError {})?;
let mut pe = device.acquire_pe(arrayinit_id).context(DeviceInitSnafu {})?;
pe.start(arg_vec).context(JobSnafu {})?;
let _out_args = pe.release(true, false).context(JobError {})?;
let _out_args = pe.release(true, false).context(JobSnafu {})?;
// check array
let p = v_boxed.as_ptr() as *mut i32;
......@@ -82,13 +82,13 @@ fn run_arrayinit(device: Arc<Device>, arrayinit_id: PEId) -> Result<()> {
from_device: true,
to_device: true,
free: true, // this parameter has no influence when SVM is active
memory: device.default_memory().context(DeviceInit {})?, // other memories currently not supported
memory: device.default_memory().context(DeviceInitSnafu {})?, // other memories currently not supported
fixed: None,
})];
let mut pe = device.acquire_pe(arrayinit_id).context(DeviceInit {})?;
pe.start(arg_vec).context(JobError {})?;
let mut pe = device.acquire_pe(arrayinit_id).context(DeviceInitSnafu {})?;
pe.start(arg_vec).context(JobSnafu {})?;
let (_ret, out_vecs) = pe.release(true, false).context(JobError {})?;
let (_ret, out_vecs) = pe.release(true, false).context(JobSnafu {})?;
// check array
let p = out_vecs[0].as_ptr() as *mut i32;
......@@ -133,9 +133,9 @@ fn run_arraysum(device: Arc<Device>, arraysum_id: PEId) -> Result<()> {
// -> wrapping the pointer in the VirtualAddress argument type provides a
// check whether the loaded bitstream actually supports SVM
let arg_vec = vec![PEParameter::VirtualAddress(v_boxed.as_ptr())];
let mut pe = device.acquire_pe(arraysum_id).context(DeviceInit {})?;
pe.start(arg_vec).context(JobError {})?;
let (ret, _out_vecs) = pe.release(true, true).context(JobError {})?;
let mut pe = device.acquire_pe(arraysum_id).context(DeviceInitSnafu {})?;
pe.start(arg_vec).context(JobSnafu {})?;
let (ret, _out_vecs) = pe.release(true, true).context(JobSnafu {})?;
// check result
if ret != ARRAY_SUM_RESULT {
failed_runs += 1;
......@@ -165,13 +165,13 @@ fn run_arraysum(device: Arc<Device>, arraysum_id: PEId) -> Result<()> {
from_device: false,
to_device: true,
free: true, // this parameter has no influence when SVM is active
memory: device.default_memory().context(DeviceInit {})?, // other memories currently not supported
memory: device.default_memory().context(DeviceInitSnafu {})?, // other memories currently not supported
fixed: None,
})];
let mut pe = device.acquire_pe(arraysum_id).context(DeviceInit {})?;
pe.start(arg_vec).context(JobError {})?;
let mut pe = device.acquire_pe(arraysum_id).context(DeviceInitSnafu {})?;
pe.start(arg_vec).context(JobSnafu {})?;
let (ret, _out_vecs) = pe.release(true, true).context(JobError {})?;
let (ret, _out_vecs) = pe.release(true, true).context(JobSnafu {})?;
// check result
if ret != ARRAY_SUM_RESULT {
......@@ -207,10 +207,10 @@ fn run_arrayupdate(device: Arc<Device>, arrayupdate_id: PEId) -> Result<()> {
// -> wrapping the pointer in the VirtualAddress argument type provides a
// check whether the loaded bitstream actually supports SVM
let arg_vec = vec![PEParameter::VirtualAddress(v_boxed.as_ptr())];
let mut pe = device.acquire_pe(arrayupdate_id).context(DeviceInit {})?;
pe.start(arg_vec).context(JobError {})?;
let mut pe = device.acquire_pe(arrayupdate_id).context(DeviceInitSnafu {})?;
pe.start(arg_vec).context(JobSnafu {})?;
let _out_args = pe.release(true, false).context(JobError {})?;
let _out_args = pe.release(true, false).context(JobSnafu {})?;
// check array
let p = v_boxed.as_ptr() as *mut i32;
......@@ -248,13 +248,13 @@ fn run_arrayupdate(device: Arc<Device>, arrayupdate_id: PEId) -> Result<()> {
from_device: true,
to_device: true,
free: true, // this parameter has no influence when SVM is active
memory: device.default_memory().context(DeviceInit {})?, // other memories currently not supported
memory: device.default_memory().context(DeviceInitSnafu {})?, // other memories currently not supported
fixed: None,
})];
let mut pe = device.acquire_pe(arrayupdate_id).context(DeviceInit {})?;
pe.start(arg_vec).context(JobError {})?;
let mut pe = device.acquire_pe(arrayupdate_id).context(DeviceInitSnafu {})?;
pe.start(arg_vec).context(JobSnafu {})?;
let (_ret, out_vecs) = pe.release(true, false).context(JobError {})?;
let (_ret, out_vecs) = pe.release(true, false).context(JobSnafu {})?;
// check array
let p = out_vecs[0].as_ptr() as *mut i32;
......@@ -296,28 +296,28 @@ fn run_pipeline(device: Arc<Device>, arrayinit_id: PEId, arraysum_id: PEId, arra
from_device: false,
to_device: true,
free: true, // this parameter has no influence when SVM is active
memory: device.default_memory().context(DeviceInit {})?, // other memories currently not supported
memory: device.default_memory().context(DeviceInitSnafu {})?, // other memories currently not supported
fixed: None,
})];
let mut arrayinit_pe = device.acquire_pe(arrayinit_id).context(DeviceInit {})?;
arrayinit_pe.start(arrayinit_args).context(JobError {})?;
let mut arrayinit_pe = device.acquire_pe(arrayinit_id).context(DeviceInitSnafu {})?;
arrayinit_pe.start(arrayinit_args).context(JobSnafu {})?;
// do not forget to regain ownership of our array (returned in out_vecs vector although we did not set 'from_device'!)
let (_ret, out_init) = arrayinit_pe.release(true, false).context(JobError {})?;
let (_ret, out_init) = arrayinit_pe.release(true, false).context(JobSnafu {})?;
// for arrayupdate and arraysum we now simply pass the array's base address since
// the data is already present in device memory
let arrayupdate_args = vec![PEParameter::VirtualAddress(out_init[0].as_ptr())];
let mut arrayupdate_pe = device.acquire_pe(arrayupdate_id).context(DeviceInit {})?;
arrayupdate_pe.start(arrayupdate_args).context(JobError {})?;
let mut arrayupdate_pe = device.acquire_pe(arrayupdate_id).context(DeviceInitSnafu {})?;
arrayupdate_pe.start(arrayupdate_args).context(JobSnafu {})?;
let (_ret, _out_update) = arrayupdate_pe.release(true, false).context(JobError {})?;
let (_ret, _out_update) = arrayupdate_pe.release(true, false).context(JobSnafu {})?;
let arraysum_args = vec![PEParameter::VirtualAddress(out_init[0].as_ptr())];
let mut arraysum_pe = device.acquire_pe(arraysum_id).context(DeviceInit {})?;
arraysum_pe.start(arraysum_args).context(JobError {})?;
let mut arraysum_pe = device.acquire_pe(arraysum_id).context(DeviceInitSnafu {})?;
arraysum_pe.start(arraysum_args).context(JobSnafu {})?;
let (ret, _out_sum) = arraysum_pe.release(true, true).context(JobError {})?;
let (ret, _out_sum) = arraysum_pe.release(true, true).context(JobSnafu {})?;
// calculate reference result
let mut ref_sum = 0u64;
......@@ -337,11 +337,11 @@ fn run_pipeline(device: Arc<Device>, arrayinit_id: PEId, arraysum_id: PEId, arra
fn main() -> Result<()> {
env_logger::init();
let tlkm = TLKM::new().context(TLKMInit {})?;
let devices = tlkm.device_enum(&HashMap::new()).context(TLKMInit)?;
let tlkm = TLKM::new().context(TLKMInitSnafu {})?;
let devices = tlkm.device_enum(&HashMap::new()).context(TLKMInitSnafu)?;
for mut x in devices {
x.change_access(tapasco::tlkm::tlkm_access::TlkmAccessExclusive)
.context(DeviceInit {})?;
.context(DeviceInitSnafu {})?;
// get IDs
let arrayinit_id = match x.get_pe_id("esa.cs.tu-darmstadt.de:hls:arrayinit:1.0") {
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
name = "libtapasco_tests"
version = "1.0.0"
authors = ["Jaco Hofmann <hofmann@esa.tu-darmstadt.de>"]
edition = "2018"
edition = "2021"
[profile.release]
opt-level = 3
......@@ -11,15 +11,15 @@ lto = "fat"
[dependencies]
tapasco = { path = "../../../libtapasco" }
env_logger = "0.7.1"
clap = "2.33.0"
log = "0.4.8"
snafu = "0.6.6"
indicatif = "0.14.0"
average = "0.10.4"
uom = "0.31.1"
rayon = "1.3.0"
env_logger = "0.9.0"
clap = "3.1.6"
log = "0.4.14"
snafu = "0.7.0"
indicatif = "0.16.2"
average = "0.13.1"
uom = "0.32.0"
rayon = "1.5.1"
num_cpus = "1.13.0"
crossbeam = "0.7.3"
rand = "0.7.3"
itertools = "0.9.0"
crossbeam = "0.8.1"
rand = "0.8.4"
itertools = "0.10.1"
......@@ -7,13 +7,13 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tui = { version = "0.16.0", default-features = false, features = ['crossterm'] }
crossterm = "0.21.0"
tui = { version = "0.17.0", default-features = false, features = ['crossterm'] }
crossterm = "0.22.0"
tapasco = { path = "../../../libtapasco", features = ["tapasco-debug"] }
snafu = "0.6.10"
snafu = "0.7.0"
chrono = "0.4.19"
log = "0.4.14"
env_logger = "0.9.0"
structopt = "0.3.23"
clap = { version = "3.1.6", features = ["derive"] }
memmap = "0.7.0"
unicode-width = "0.1.9"
......@@ -65,11 +65,11 @@ impl<'a> App<'a> {
trace!("Creating new App for Tapasco state");
// Get Tapasco Loadable Linux Kernel Module
let tlkm = TLKM::new().context(TLKMInit {})?;
let tlkm = TLKM::new().context(TLKMInitSnafu {})?;
// Allocate the device with the given ID
let tlkm_device = tlkm
.device_alloc(device_id, &HashMap::new())
.context(TLKMInit {})?;
.context(TLKMInitSnafu {})?;
// For some access modes we need to take some special care to use them
let access_mode_str = match access_mode {
......@@ -84,7 +84,7 @@ impl<'a> App<'a> {
// // Change device access to exclusive to be able to acquire PEs
// tlkm_device
// .change_access(tapasco::tlkm::tlkm_access::TlkmAccessExclusive)
// .context(DeviceInit {})?;
// .context(DeviceInitSnafu {})?;
// "Debug"
//}
AccessMode::Unsafe {} => {
......@@ -109,7 +109,7 @@ impl<'a> App<'a> {
]);
let title = format!("TaPaSCo Debugger - {} Mode", access_mode_str);
let tlkm_version = tlkm.version().context(TLKMInit {})?;
let tlkm_version = tlkm.version().context(TLKMInitSnafu {})?;
let platform_base = tlkm_device
.status()
.platform_base
......@@ -137,7 +137,7 @@ impl<'a> App<'a> {
// Warning: casting to usize can panic! On a <32-bit system..
let pe = tlkm_device
.acquire_pe_without_job(pe.id as usize)
.context(DeviceInit {})?;
.context(DeviceInitSnafu {})?;
// TODO: There is no way to check that you really got the PE that you wanted
// so I have to use this workaround to set it at the ID of the PE struct which
// confusingly is NOT the pe.id from above which is stored at type_id inside the PE.
......
......@@ -25,7 +25,7 @@ enum Error {
type Result<T, E = Error> = std::result::Result<T, E>;
use structopt::StructOpt;
use clap::StructOpt;
// TODO: 1. When issue #296 is fixed, remove the paragraph about the `EMFILE` error.
/// The interactive `TaPaSCo` Debugger can be used to retrieve information about the loaded
......@@ -36,7 +36,7 @@ use structopt::StructOpt;
#[structopt(rename_all = "kebab-case")]
struct Opt {
/// The Device ID of the FPGA you want to use if you got more than one
#[structopt(short = "d", long = "device", default_value = "0")]
#[structopt(short = 'd', long = "device", default_value = "0")]
device_id: u32,
/// Specify the Access Mode as subcommand
......@@ -60,10 +60,10 @@ fn init() -> Result<()> {
let Opt {
device_id,
subcommand,
} = Opt::from_args();
} = Opt::parse();
// Specify the Access Mode as subcommand and setup the App and UI
ui::setup(&mut app::App::new(device_id, subcommand).context(App {})?).context(UI {})
ui::setup(&mut app::App::new(device_id, subcommand).context(AppSnafu {})?).context(UISnafu {})
}
fn main() {
......
......@@ -47,26 +47,26 @@ enum Event<I, H> {
pub fn setup(app: &mut App) -> Result<()> {
// Raw mode disables some common terminal functions that are unnecessary in the TUI environment
enable_raw_mode().context(Crossterm {})?;
enable_raw_mode().context(CrosstermSnafu {})?;
// Enter the Alternate Screen, so we don't break terminal history (it's like opening vim)
let mut stdout = stdout();
execute!(stdout, EnterAlternateScreen).context(Crossterm {})?;
execute!(stdout, EnterAlternateScreen).context(CrosstermSnafu {})?;
// Initialize Crossterm backend
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend).context(Crossterm {})?;
let mut terminal = Terminal::new(backend).context(CrosstermSnafu {})?;
// Clear the Alternate Screen if someone left it dirty
terminal.clear().context(Crossterm {})?;
terminal.clear().context(CrosstermSnafu {})?;
// Save the result of the main loop to return it after tearing down the backend
let result = run_event_loop(app, &mut terminal);
// Leave Alternate Screen to shut down cleanly regardless of the result
disable_raw_mode().context(Crossterm {})?;
execute!(terminal.backend_mut(), LeaveAlternateScreen).context(Crossterm {})?;
terminal.show_cursor().context(Crossterm {})?;
disable_raw_mode().context(CrosstermSnafu {})?;
execute!(terminal.backend_mut(), LeaveAlternateScreen).context(CrosstermSnafu {})?;
terminal.show_cursor().context(CrosstermSnafu {})?;
// Return the result of the main loop after restoring the previous terminal state in order to
// not be stuck in the Alternate Screen / or Raw Mode which would make a `reset` of the shell
......@@ -100,7 +100,7 @@ fn run_event_loop<B: Backend>(app: &mut App, terminal: &mut Terminal<B>) -> Resu
draw(app, terminal)?;
// Handle events
match rx.recv().context(ReceiveInput {})? {
match rx.recv().context(ReceiveInputSnafu {})? {
// Match key pressed events
Event::Input(event) => {
trace!("Input event: {:?}", event);
......@@ -216,7 +216,7 @@ fn draw<B: Backend>(app: &mut App, terminal: &mut Terminal<B>) -> Result<()> {
2 => draw_tab_bitstream_and_device_info(f, app, tabs_chunks[2]),
_ => {},
}
}).context(Crossterm {})?;
}).context(CrosstermSnafu {})?;
Ok(())
}
......
......@@ -2,7 +2,7 @@
name = "tapasco"
version = "1.0.0"
authors = ["Jaco Hofmann <hofmann@esa.tu-darmstadt.de>"]
edition = "2018"
edition = "2021"
[lib]
crate-type = ["staticlib", "rlib"]
......@@ -19,23 +19,22 @@ default = []
tapasco-debug = []
[dependencies]
log = "0.4.8"
chrono = "0.4.11"
nix = "0.17.0"
log = "0.4.14"
chrono = "0.4.19"
nix = "0.23.1"
memmap = "0.7.0"
getset = "0.1.0"
snafu = "0.6.6"
prost = "0.6.1"
env_logger = "0.7.1"
getset = "0.1.1"
snafu = "0.7.0"
prost = "0.9.0"
env_logger = "0.9.0"
lockfree = "0.5.1"
crossbeam = "0.7.3"
volatile = "0.2.6"
bytes = "0.5.4"
libc = "0.2.70"
config = "0.10.1"
serde = "1.0.115"
vfio-bindings = "0.2.0"
crossbeam = "0.8.1"
bytes = "1.1.0"
libc = "0.2.102"
config = "0.12.0"
serde = "1.0.130"
vfio-bindings = "0.3.1"
[build-dependencies]
prost-build = "0.6.1"
cbindgen = "0.14.2"
prost-build = "0.9.0"
cbindgen = "0.20.0"
......@@ -488,7 +488,7 @@ impl Allocator for DriverAllocator {
sz: 0,
dev_addr: ptr,
};
unsafe { tlkm_ioctl_free(self.tlkm_file.as_raw_fd(), &mut cmd).context(IOCTLFree)? };
unsafe { tlkm_ioctl_free(self.tlkm_file.as_raw_fd(), &mut cmd).context(IOCTLFreeSnafu)? };
Ok(())
}
}
......
......@@ -275,11 +275,11 @@ impl Device {
.open(format!(
"{}{:02}",
settings
.get_str("tlkm.device_driver_file")
.context(ConfigError)?,
.get_string("tlkm.device_driver_file")
.context(ConfigSnafu)?,
id
))
.context(DeviceUnavailable { id })?,
.context(DeviceUnavailableSnafu { id })?,
);
trace!("Mapping status core.");
......@@ -289,7 +289,7 @@ impl Device {
.len(8192)
.offset(0)
.map(&tlkm_dma_file)
.context(DeviceUnavailable { id })?
.context(DeviceUnavailableSnafu { id })?
};
trace!("Mapped status core: {}", mmap[0]);
......@@ -302,7 +302,7 @@ impl Device {
mmap_cpy[i] = mmap[i];
}
status::Status::decode_length_delimited(&mmap_cpy[..]).context(StatusCoreDecoding)?
status::Status::decode_length_delimited(&mmap_cpy[..]).context(StatusCoreDecodingSnafu)?
};
trace!("Status core decoded: {:?}", s);
......@@ -321,7 +321,7 @@ impl Device {
.len(platform_size as usize)
.offset(8192)
.map_mut(&tlkm_dma_file)
.context(DeviceUnavailable { id })?
.context(DeviceUnavailableSnafu { id })?
});
let arch_size = match &s.arch_base {
......@@ -336,7 +336,7 @@ impl Device {
.len(arch_size as usize)
.offset(4096)
.map_mut(&tlkm_dma_file)
.context(DeviceUnavailable { id })?
.context(DeviceUnavailableSnafu { id })?
});
// Initialize the global memories.
......@@ -385,7 +385,7 @@ impl Device {
allocator.push(Arc::new(OffchipMemory {
allocator: Mutex::new(Box::new(
GenericAllocator::new(0, 4 * 1024 * 1024 * 1024, 64).context(AllocatorError)?,
GenericAllocator::new(0, 4 * 1024 * 1024 * 1024, 64).context(AllocatorSnafu)?,
)),
dma: Box::new(
UserSpaceDMA::new(
......@@ -396,18 +396,18 @@ impl Device {
&platform,
settings
.get::<usize>("dma.read_buffer_size")
.context(ConfigError)?,
.context(ConfigSnafu)?,
settings
.get::<usize>("dma.read_buffers")
.context(ConfigError)?,
.context(ConfigSnafu)?,
settings
.get::<usize>("dma.write_buffer_size")
.context(ConfigError)?,
.context(ConfigSnafu)?,
settings
.get::<usize>("dma.write_buffers")
.context(ConfigError)?,
.context(ConfigSnafu)?,
)
.context(DMAError)?,
.context(DMASnafu)?,
),
}));
} else {
......@@ -419,7 +419,7 @@ impl Device {
tlkm_ioctl_svm_launch(
tlkm_dma_file.as_raw_fd(),
&mut init_cmd,
).context(SVMInitError)?;
).context(SVMInitSnafu)?;
}
allocator.push(Arc::new(OffchipMemory {
allocator: Mutex::new(Box::new(DummyAllocator::new())),
......@@ -430,18 +430,18 @@ impl Device {
info!("Using driver allocation for Zynq/ZynqMP based platform.");
allocator.push(Arc::new(OffchipMemory {
allocator: Mutex::new(Box::new(
DriverAllocator::new(&tlkm_dma_file).context(AllocatorError)?,
DriverAllocator::new(&tlkm_dma_file).context(AllocatorSnafu)?,
)),
dma: Box::new(DriverDMA::new(&tlkm_dma_file)),
}));
} else if name == "zynqmp" {
info!("Using VFIO mode for ZynqMP based platform.");
let vfio_dev = Arc::new(init_vfio(settings)
.context(VfioInitError)?
.context(VfioInitSnafu)?
);
allocator.push(Arc::new(OffchipMemory {
allocator: Mutex::new(Box::new(
VfioAllocator::new(&vfio_dev).context(AllocatorError)?,
VfioAllocator::new(&vfio_dev).context(AllocatorSnafu)?,
)),
dma: Box::new(VfioDMA::new(&vfio_dev)),
}));
......@@ -457,7 +457,7 @@ impl Device {
Some(l) => {
pe_local_memories.push_back(Arc::new(OffchipMemory {
allocator: Mutex::new(Box::new(
GenericAllocator::new(0, l.size, 1).context(AllocatorError)?,
GenericAllocator::new(0, l.size, 1).context(AllocatorSnafu)?,
)),
dma: Box::new(DirectDMA::new(l.base, l.size, arch.clone())),
}));
......@@ -480,7 +480,7 @@ impl Device {
is_pcie,
svm_in_use,
)
.context(SchedulerError)?,
.context(SchedulerSnafu)?,
);
trace!("Device creation completed.");
......@@ -514,7 +514,7 @@ impl Device {
pub fn acquire_pe(&self, id: PEId) -> Result<Job> {
self.check_exclusive_access()?;
trace!("Trying to acquire PE of type {}.", id);
let pe = self.scheduler.acquire_pe(id).context(SchedulerError)?;
let pe = self.scheduler.acquire_pe(id).context(SchedulerSnafu)?;
trace!("Successfully acquired PE of type {}.", id);
Ok(Job::new(pe, &self.scheduler))
}
......@@ -530,7 +530,7 @@ impl Device {
"Trying to acquire PE of type {} without exclusive access.",
id
);
let pe = self.scheduler.acquire_pe(id).context(SchedulerError)?;
let pe = self.scheduler.acquire_pe(id).context(SchedulerSnafu)?;
trace!(
"Successfully acquired PE of type {} without exclusive access.",
id
......@@ -569,7 +569,7 @@ impl Device {
trace!("Device {}: Trying to change mode to {:?}", self.id, access,);
unsafe {
tlkm_ioctl_create(self.tlkm_file.as_raw_fd(), &mut request).context(IOCTLCreate {
tlkm_ioctl_create(self.tlkm_file.as_raw_fd(), &mut request).context(IOCTLCreateSnafu {
access,
id: self.id,
})?;
......@@ -579,7 +579,7 @@ impl Device {
if access == tlkm_access::TlkmAccessExclusive {
trace!("Access changed to exclusive, resetting all interrupts.");
self.scheduler.reset_interrupts().context(SchedulerError)?;
self.scheduler.reset_interrupts().context(SchedulerSnafu)?;
}
trace!("Successfully acquired access.");
......@@ -596,7 +596,7 @@ impl Device {
};