Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
Change-Id: I4fdbed879d85013c7e6f0e0157dcba7f92fb943b
  • Loading branch information
Lawrence Esswood committed Oct 14, 2024
1 parent a5ee396 commit fd51098
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion doc/wg/core/notes/core-notes-2022-03-04.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Attendees:

* Hudson: Does anyone else have any context about the want for using
`usize`-sized return values? Jett posted issue #2981 -- he wants to have
`FailureUsize` and `SuccessUsize` return variants.
`FailureUsize` and `SUCCESS_USIZE` return variants.
* Alyssa: I can give a bit of background on this. Essentially, it is because of
host emulation, where `usize` is 64 bits. You can't really return pointers
from Command anymore. [Editor's note: Alyssa's last sentence was hard to hear]
Expand Down
20 changes: 10 additions & 10 deletions kernel/src/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ pub enum SyscallReturnVariant {
SuccessU32U32U32 = 132,
SuccessU32U64 = 133,
SuccessUsize = 134,
SucessPtr = 135,
SucessPtrUsize = 136,
SucessPtrPtr = 137,
SuccessPtr = 135,
SuccessPtrUsize = 136,
SuccessPtrPtr = 137,
}

impl SyscallReturnVariant {
Expand All @@ -421,8 +421,8 @@ impl SyscallReturnVariant {
if compat {
match self {
// Map all usizes and ptrs to u32
Self::SuccessUsize | Self::SucessPtr => Self::SuccessU32,
Self::SucessPtrUsize | Self::SucessPtrPtr => Self::SuccessU32U32,
Self::SuccessUsize | Self::SuccessPtr => Self::SuccessU32,
Self::SuccessPtrUsize | Self::SuccessPtrPtr => Self::SuccessU32U32,
Self::FailurePtrUsize | Self::FailurePtrPtr => Self::FailureU32U32,
x => x,
}
Expand Down Expand Up @@ -681,7 +681,7 @@ impl SyscallReturn {
write_64(a2, a3, data1);
}
SyscallReturn::AllowReadWriteSuccess(ptr, len) => {
*a0 = (SyscallReturnVariant::SucessPtrUsize.into_compat() as usize).into();
*a0 = (SyscallReturnVariant::SuccessPtrUsize.into_compat() as usize).into();
*a1 = MetaPtr::new_with_metadata(
ptr as *const (),
ptr as usize,
Expand All @@ -691,7 +691,7 @@ impl SyscallReturn {
*a2 = len.into();
}
SyscallReturn::UserspaceReadableAllowSuccess(ptr, len) => {
*a0 = (SyscallReturnVariant::SucessPtrUsize.into_compat() as usize).into();
*a0 = (SyscallReturnVariant::SuccessPtrUsize.into_compat() as usize).into();
*a1 = MetaPtr::new_with_metadata(
ptr as *const (),
ptr as usize,
Expand Down Expand Up @@ -723,7 +723,7 @@ impl SyscallReturn {
*a3 = len.into();
}
SyscallReturn::AllowReadOnlySuccess(ptr, len) => {
*a0 = (SyscallReturnVariant::SucessPtrUsize.into_compat() as usize).into();
*a0 = (SyscallReturnVariant::SuccessPtrUsize.into_compat() as usize).into();
*a1 = MetaPtr::new_with_metadata(
ptr as *const (),
ptr as usize,
Expand All @@ -744,7 +744,7 @@ impl SyscallReturn {
*a3 = len.into();
}
SyscallReturn::SubscribeSuccess(ptr, data) => {
*a0 = (SyscallReturnVariant::SucessPtrPtr.into_compat() as usize).into();
*a0 = (SyscallReturnVariant::SuccessPtrPtr.into_compat() as usize).into();
*a1 = (ptr as usize).into();
*a2 = data.into();
}
Expand All @@ -755,7 +755,7 @@ impl SyscallReturn {
*a3 = data.into();
}
SyscallReturn::SuccessPtr(metaptr) => {
*a0 = (SyscallReturnVariant::SucessPtr.into_compat() as usize).into();
*a0 = (SyscallReturnVariant::SuccessPtr.into_compat() as usize).into();
*a1 = metaptr;
}
SyscallReturn::YieldWaitFor(data0, data1, data2) => {
Expand Down

0 comments on commit fd51098

Please sign in to comment.