diff options
| author | Fenrir <[email protected]> | 2017-06-06 17:10:20 -0600 |
|---|---|---|
| committer | Fenrir <[email protected]> | 2017-07-10 11:30:57 -0600 |
| commit | a572fa0a5aca2c990ecc5a8a0aaf48df4b67c4f2 (patch) | |
| tree | 21cd16fab40e0d8368f06f383d47e6741ea9c383 /ctr-std/src/sys | |
| parent | Handle linking in ctru-rs build script (diff) | |
| download | ctru-rs-a572fa0a5aca2c990ecc5a8a0aaf48df4b67c4f2.tar.xz ctru-rs-a572fa0a5aca2c990ecc5a8a0aaf48df4b67c4f2.zip | |
Update libraries for ctru-sys changes
Diffstat (limited to 'ctr-std/src/sys')
| -rw-r--r-- | ctr-std/src/sys/unix/condvar.rs | 4 | ||||
| -rw-r--r-- | ctr-std/src/sys/unix/mutex.rs | 24 | ||||
| -rw-r--r-- | ctr-std/src/sys/unix/rand.rs | 2 | ||||
| -rw-r--r-- | ctr-std/src/sys/unix/thread.rs | 8 | ||||
| -rw-r--r-- | ctr-std/src/sys/unix/time.rs | 2 |
5 files changed, 19 insertions, 21 deletions
diff --git a/ctr-std/src/sys/unix/condvar.rs b/ctr-std/src/sys/unix/condvar.rs index 51ff665..b32298c 100644 --- a/ctr-std/src/sys/unix/condvar.rs +++ b/ctr-std/src/sys/unix/condvar.rs @@ -17,8 +17,8 @@ use time::Duration; use sys::mutex::{self, Mutex}; -use libctru::synchronization::{__sync_get_arbiter, LightLock}; -use libctru::svc::{svcArbitrateAddress, ArbitrationType}; +use libctru::{__sync_get_arbiter, LightLock}; +use libctru::{svcArbitrateAddress, ArbitrationType}; pub struct Condvar { lock: UnsafeCell<*mut LightLock>, diff --git a/ctr-std/src/sys/unix/mutex.rs b/ctr-std/src/sys/unix/mutex.rs index d4fd2c2..0cfd392 100644 --- a/ctr-std/src/sys/unix/mutex.rs +++ b/ctr-std/src/sys/unix/mutex.rs @@ -11,12 +11,10 @@ use cell::UnsafeCell; use mem; -use libctru::synchronization; - -pub struct Mutex { inner: UnsafeCell<synchronization::LightLock> } +pub struct Mutex { inner: UnsafeCell<::libctru::LightLock> } #[inline] -pub unsafe fn raw(m: &Mutex) -> *mut synchronization::LightLock { +pub unsafe fn raw(m: &Mutex) -> *mut ::libctru::LightLock { m.inner.get() } @@ -30,19 +28,19 @@ impl Mutex { } #[inline] pub unsafe fn init(&mut self) { - synchronization::LightLock_Init(self.inner.get()); + ::libctru::LightLock_Init(self.inner.get()); } #[inline] pub unsafe fn lock(&self) { - synchronization::LightLock_Lock(self.inner.get()); + ::libctru::LightLock_Lock(self.inner.get()); } #[inline] pub unsafe fn unlock(&self) { - synchronization::LightLock_Unlock(self.inner.get()); + ::libctru::LightLock_Unlock(self.inner.get()); } #[inline] pub unsafe fn try_lock(&self) -> bool { - match synchronization::LightLock_TryLock(self.inner.get()) { + match ::libctru::LightLock_TryLock(self.inner.get()) { 0 => true, _ => false, } @@ -51,7 +49,7 @@ impl Mutex { pub unsafe fn destroy(&self) {} } -pub struct ReentrantMutex { inner: UnsafeCell<synchronization::RecursiveLock> } +pub struct ReentrantMutex { inner: UnsafeCell<::libctru::RecursiveLock> } unsafe impl Send for ReentrantMutex {} unsafe impl Sync for ReentrantMutex {} @@ -62,19 +60,19 @@ impl ReentrantMutex { } #[inline] pub unsafe fn init(&mut self) { - synchronization::RecursiveLock_Init(self.inner.get()); + ::libctru::RecursiveLock_Init(self.inner.get()); } #[inline] pub unsafe fn lock(&self) { - synchronization::RecursiveLock_Lock(self.inner.get()); + ::libctru::RecursiveLock_Lock(self.inner.get()); } #[inline] pub unsafe fn unlock(&self) { - synchronization::RecursiveLock_Unlock(self.inner.get()); + ::libctru::RecursiveLock_Unlock(self.inner.get()); } #[inline] pub unsafe fn try_lock(&self) -> bool { - match synchronization::RecursiveLock_TryLock(self.inner.get()) { + match ::libctru::RecursiveLock_TryLock(self.inner.get()) { 0 => true, _ => false, } diff --git a/ctr-std/src/sys/unix/rand.rs b/ctr-std/src/sys/unix/rand.rs index 7fdc166..39c967a 100644 --- a/ctr-std/src/sys/unix/rand.rs +++ b/ctr-std/src/sys/unix/rand.rs @@ -12,7 +12,7 @@ use io::{self, Error, ErrorKind}; use mem; use rand::Rng; -use libctru::services::sslc::{sslcInit, sslcExit, sslcGenerateRandomData}; +use libctru::{sslcInit, sslcExit, sslcGenerateRandomData}; pub struct OsRng(()); diff --git a/ctr-std/src/sys/unix/thread.rs b/ctr-std/src/sys/unix/thread.rs index 572ac72..a7178a3 100644 --- a/ctr-std/src/sys/unix/thread.rs +++ b/ctr-std/src/sys/unix/thread.rs @@ -18,9 +18,9 @@ use ptr; use sys_common::thread::start_thread; use time::Duration; -use libctru::svc::{svcSleepThread, svcGetThreadPriority}; -use libctru::thread::{threadCreate, threadJoin, threadFree}; -use libctru::thread::Thread as ThreadHandle; +use libctru::{svcSleepThread, svcGetThreadPriority}; +use libctru::{threadCreate, threadJoin, threadFree}; +use libctru::Thread as ThreadHandle; pub struct Thread { handle: ThreadHandle, @@ -44,7 +44,7 @@ impl Thread { priority -= 1; let handle = threadCreate(Some(thread_func), &*p as *const _ as *mut _, - stack_size, priority, -2, 0); + stack_size, priority, -2, false); return if handle == ptr::null_mut() { Err(io::Error::from_raw_os_error(libc::EAGAIN)) diff --git a/ctr-std/src/sys/unix/time.rs b/ctr-std/src/sys/unix/time.rs index e8c0632..3bc1dca 100644 --- a/ctr-std/src/sys/unix/time.rs +++ b/ctr-std/src/sys/unix/time.rs @@ -192,7 +192,7 @@ mod inner { // Gets the current system tick #[inline] fn get_system_tick() -> u64 { - unsafe { libctru::svc::svcGetSystemTick() } + unsafe { libctru::svcGetSystemTick() } } // A struct representing the clock speed of the 3DS |