Skip to content

Commit fa14cdc

Browse files
committed
Upgrades all crates to 2024 edition
1 parent 8ed227d commit fa14cdc

File tree

17 files changed

+46
-47
lines changed

17 files changed

+46
-47
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "okf"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lints.rust]
77
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(fw, values("1100"))'] }

macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "okf-macros"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lib]
77
proc-macro = true

ps4-1100/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[package]
2-
name = "okf-1100"
2+
name = "ps4-1100"
33
version = "0.1.0"
4-
edition = "2021"
5-
links = "orbiskernel"
4+
edition = "2024"
65

76
[dependencies]
87
okf = { version = "0.1.0", path = "../" }

ps4-1100/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use okf::malloc::MallocFlags;
1818
use okf::queue::TailQueue;
1919
use okf::socket::SockAddr;
2020
use okf::uio::UioSeg;
21-
use okf::{offset, panic_handler, MappedKernel, StaticMut};
21+
use okf::{MappedKernel, StaticMut, offset, panic_handler};
2222

2323
mod file;
2424
mod lock;
@@ -190,7 +190,7 @@ impl okf::Kernel for Kernel {
190190

191191
#[offset(0x264620)]
192192
unsafe fn solisten(self, so: *mut Self::Socket, backlog: c_int, td: *mut Self::Thread)
193-
-> c_int;
193+
-> c_int;
194194

195195
#[offset(0x21DC40)]
196196
unsafe fn strlen(self, s: *const c_char) -> usize;

ps4-1100/src/mount.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use crate::Kernel;
12
use crate::lock::Mtx;
23
use crate::vnode::Vnode;
3-
use crate::Kernel;
44
use core::ffi::{c_char, c_int};
55
use core::mem::MaybeUninit;
66
use core::num::NonZero;
@@ -73,11 +73,11 @@ pub struct FsOps {
7373
impl okf::mount::FsOps<Kernel> for FsOps {
7474
unsafe fn root(&self, mp: *mut Mount, flags: c_int) -> Result<*mut Vnode, NonZero<c_int>> {
7575
let mut vp = MaybeUninit::uninit();
76-
let errno = (self.root)(mp, flags, vp.as_mut_ptr());
76+
let errno = unsafe { (self.root)(mp, flags, vp.as_mut_ptr()) };
7777

7878
match NonZero::new(errno) {
7979
Some(v) => Err(v),
80-
None => Ok(vp.assume_init()),
80+
None => Ok(unsafe { vp.assume_init() }),
8181
}
8282
}
8383
}

ps4-1100/src/namei.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ impl okf::namei::ComponentName<crate::Kernel> for ComponentName {
2525
op,
2626
flags: 0,
2727
td,
28-
cred: (*td).cred(),
28+
cred: unsafe { (*td).cred() },
2929
lk,
3030
buf,
3131
name: buf,
32-
len: k.strlen(buf) as _,
32+
len: unsafe { k.strlen(buf) as _ },
3333
consume: 0,
3434
}
3535
}

ps4-1100/src/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::ucred::Ucred;
21
use crate::Kernel;
2+
use crate::ucred::Ucred;
33

44
/// Implementation of [`okf::thread::Thread`] for 11.00.
55
#[repr(C)]

ps4-1100/src/uio.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::thread::Thread;
21
use crate::Kernel;
2+
use crate::thread::Thread;
33
use core::ffi::c_int;
44
use okf::uio::{IoVec, UioRw, UioSeg};
55

@@ -17,7 +17,7 @@ pub struct Uio {
1717

1818
impl okf::uio::Uio<Kernel> for Uio {
1919
unsafe fn write(iov: *mut IoVec, td: *mut Thread) -> Option<Self> {
20-
let res = (*iov).len;
20+
let res = unsafe { (*iov).len };
2121

2222
if res > Self::io_max() {
2323
return None;
@@ -35,7 +35,7 @@ impl okf::uio::Uio<Kernel> for Uio {
3535
}
3636

3737
unsafe fn read(iov: *mut IoVec, off: usize, td: *mut Thread) -> Option<Self> {
38-
let res = (*iov).len;
38+
let res = unsafe { (*iov).len };
3939

4040
if res > Self::io_max() {
4141
return None;

src/fd/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use crate::Kernel;
12
use crate::pcpu::Pcpu;
23
use crate::thread::Thread;
34
use crate::uio::{IoVec, Uio, UioSeg};
4-
use crate::Kernel;
55
use bitflags::bitflags;
66
use core::ffi::{c_char, c_int};
77
use core::marker::PhantomData;
@@ -21,13 +21,13 @@ pub unsafe fn openat<K: Kernel>(
2121
mode: c_int,
2222
) -> Result<OwnedFd<K>, NonZero<c_int>> {
2323
let td = K::Pcpu::curthread();
24-
let errno = kern.kern_openat(td, fd, path, seg, flags, mode);
24+
let errno = unsafe { kern.kern_openat(td, fd, path, seg, flags, mode) };
2525

2626
match NonZero::new(errno) {
2727
Some(v) => Err(v),
2828
None => Ok(OwnedFd {
2929
kern,
30-
fd: (*td).ret(0).try_into().unwrap(),
30+
fd: unsafe { (*td).ret(0).try_into().unwrap() },
3131
phantom: PhantomData,
3232
}),
3333
}
@@ -43,7 +43,7 @@ pub unsafe fn write_all<K: Kernel>(
4343
td: *mut K::Thread,
4444
) -> Result<(), NonZero<c_int>> {
4545
while !data.is_empty() {
46-
let written = match write(kern, fd, data, td) {
46+
let written = match unsafe { write(kern, fd, data, td) } {
4747
Ok(v) => v,
4848
Err(e) if e == K::EINTR => continue,
4949
Err(e) => return Err(e),
@@ -75,12 +75,12 @@ pub unsafe fn write<K: Kernel>(
7575
};
7676

7777
// Write.
78-
let mut uio = K::Uio::write(&mut vec, td).unwrap();
79-
let errno = kern.kern_writev(td, fd, &mut uio);
78+
let mut uio = unsafe { K::Uio::write(&mut vec, td).unwrap() };
79+
let errno = unsafe { kern.kern_writev(td, fd, &mut uio) };
8080

8181
match NonZero::new(errno) {
8282
Some(v) => Err(v),
83-
None => Ok((*td).ret(0)),
83+
None => Ok(unsafe { (*td).ret(0) }),
8484
}
8585
}
8686

src/file/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use crate::pcpu::Pcpu;
21
use crate::Kernel;
2+
use crate::pcpu::Pcpu;
33
use core::ffi::c_int;
44
use core::num::NonZero;
55
use core::ptr::null_mut;
6-
use core::sync::atomic::{fence, AtomicU32, Ordering};
6+
use core::sync::atomic::{AtomicU32, Ordering, fence};
77

88
/// Represents `file` structure.
99
pub trait File: Sized {

0 commit comments

Comments
 (0)