1use std::ptr;
2use libc::*;
3
4#[repr(C)]
5pub struct VolatileCell<T> {
6 x: T
7}
8
9impl<T> VolatileCell<T> {
10 unsafe fn get(&self) -> T {
11 ptr::read_volatile(&self.x)
12 }
13 unsafe fn set(&mut self, x: T) {
14 ptr::write_volatile(&mut self.x, x)
15 }
16}
17
18pub type KernelSizeT = c_ulong;