Browse Source

Missed ordering changes

pull/50/head
Andrea Ciliberti 3 years ago
parent
commit
dda1706dc9
  1. 2
      ctru-rs/src/gfx.rs
  2. 2
      ctru-rs/src/romfs.rs
  3. 2
      ctru-rs/src/services/apt.rs
  4. 2
      ctru-rs/src/services/fs.rs
  5. 2
      ctru-rs/src/services/hid.rs
  6. 2
      ctru-rs/src/services/soc.rs
  7. 2
      ctru-rs/src/services/sslc.rs
  8. 2
      ctru-rs/src/srv.rs

2
ctru-rs/src/gfx.rs

@ -86,7 +86,7 @@ impl Gfx {
bottom_fb_fmt: FramebufferFormat, bottom_fb_fmt: FramebufferFormat,
use_vram_buffers: bool, use_vram_buffers: bool,
) -> Result<Self> { ) -> Result<Self> {
match GFX_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match GFX_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => { Ok(_) => {
unsafe { unsafe {
ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), use_vram_buffers); ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), use_vram_buffers);

2
ctru-rs/src/romfs.rs

@ -22,7 +22,7 @@ static ROMFS_ACTIVE: AtomicBool = AtomicBool::new(false);
impl RomFS { impl RomFS {
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {
match ROMFS_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match ROMFS_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => { Ok(_) => {
let mount_name = CStr::from_bytes_with_nul(b"romfs\0").unwrap(); let mount_name = CStr::from_bytes_with_nul(b"romfs\0").unwrap();
let result = unsafe { ctru_sys::romfsMountSelf(mount_name.as_ptr()) }; let result = unsafe { ctru_sys::romfsMountSelf(mount_name.as_ptr()) };

2
ctru-rs/src/services/apt.rs

@ -9,7 +9,7 @@ static APT_ACTIVE: AtomicBool = AtomicBool::new(false);
impl Apt { impl Apt {
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {
match APT_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match APT_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => { Ok(_) => {
let r = unsafe { ctru_sys::aptInit() }; let r = unsafe { ctru_sys::aptInit() };
if r < 0 { if r < 0 {

2
ctru-rs/src/services/fs.rs

@ -308,7 +308,7 @@ impl Fs {
/// as many times as desired and the service will not exit until all /// as many times as desired and the service will not exit until all
/// instances of Fs drop out of scope. /// instances of Fs drop out of scope.
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {
match FS_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match FS_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => { Ok(_) => {
let r = unsafe { ctru_sys::fsInit() }; let r = unsafe { ctru_sys::fsInit() };
if r < 0 { if r < 0 {

2
ctru-rs/src/services/hid.rs

@ -70,7 +70,7 @@ pub struct CirclePosition(ctru_sys::circlePosition);
/// rare in practice. /// rare in practice.
impl Hid { impl Hid {
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {
match HID_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match HID_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => { Ok(_) => {
let r = unsafe { ctru_sys::hidInit() }; let r = unsafe { ctru_sys::hidInit() };
if r < 0 { if r < 0 {

2
ctru-rs/src/services/soc.rs

@ -31,7 +31,7 @@ impl Soc {
/// ///
/// This function will return an error if the `Soc` service is already initialized /// This function will return an error if the `Soc` service is already initialized
pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result<Self> { pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result<Self> {
match SOC_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match SOC_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => unsafe { Ok(_) => unsafe {
let soc_mem = memalign(0x1000, num_bytes) as *mut u32; let soc_mem = memalign(0x1000, num_bytes) as *mut u32;

2
ctru-rs/src/services/sslc.rs

@ -12,7 +12,7 @@ static SSLC_ACTIVE: AtomicBool = AtomicBool::new(false);
impl SslC { impl SslC {
/// Initialize sslc /// Initialize sslc
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {
match SSLC_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match SSLC_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => { Ok(_) => {
let r = unsafe { ctru_sys::sslcInit(0) }; let r = unsafe { ctru_sys::sslcInit(0) };
if r < 0 { if r < 0 {

2
ctru-rs/src/srv.rs

@ -9,7 +9,7 @@ static SRV_ACTIVE: AtomicBool = AtomicBool::new(false);
impl Srv { impl Srv {
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {
match SRV_ACTIVE.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { match SRV_ACTIVE.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(_) => { Ok(_) => {
let r = unsafe { ctru_sys::srvInit() }; let r = unsafe { ctru_sys::srvInit() };
if r < 0 { if r < 0 {

Loading…
Cancel
Save