Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #626

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub enum ARM64Instruction {
LogicalRegister(ARM64InstructionLogicalShiftedRegister),
AddSubRegister(ARM64InstructionLogicalShiftedRegister),
AddSubImm(ARM64InstructionAddSubImm),
ConditionalBranch(ARM64InstructionConditonalBranch),
ConditionalBranch(ARM64InstructionConditionalBranch),
LogicalImm(ARM64InstructionLogicalImm),
BitfieldImm(ARM64InstructionLogicalImm),
MovWideImm(ARM64InstructionWideImm),
Expand Down Expand Up @@ -255,7 +255,7 @@ impl Default for ARM64InstructionWideImm {
}

#[derive(Copy, Clone)]
pub struct ARM64InstructionConditonalBranch {
pub struct ARM64InstructionConditionalBranch {
pub cond: u8, // 4 bits
pub imm19: i32, // offset from current instruction, divided by 4
}
Expand Down Expand Up @@ -819,7 +819,7 @@ impl ARM64Instruction {
// WARNING: You need to divide the byte offset by 4 before passing as imm19
#[must_use]
pub fn b_cond(cond: Condition, imm19: i32) -> Self {
Self::ConditionalBranch(ARM64InstructionConditonalBranch {
Self::ConditionalBranch(ARM64InstructionConditionalBranch {
cond: cond as u8,
imm19,
})
Expand Down
6 changes: 3 additions & 3 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub enum ElfError {
/// Entrypoint out of bounds
#[error("Entrypoint out of bounds")]
EntrypointOutOfBounds,
/// Invaid entrypoint
#[error("Invaid entrypoint")]
/// Invalid entrypoint
#[error("Invalid entrypoint")]
InvalidEntrypoint,
/// Failed to get section
#[error("Failed to get section {0}")]
Expand All @@ -68,7 +68,7 @@ pub enum ElfError {
/// Incompatible ELF: wrong ABI
#[error("Incompatible ELF: wrong ABI")]
WrongAbi,
/// Incompatible ELF: wrong mchine
/// Incompatible ELF: wrong machine
#[error("Incompatible ELF: wrong machine")]
WrongMachine,
/// Incompatible ELF: wrong class
Expand Down
2 changes: 1 addition & 1 deletion src/elf_parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub enum ElfParserError {
/// Section or symbol name is too long
#[error("Section or symbol name `{0}` is longer than `{1}` bytes")]
StringTooLong(String, usize),
/// An index or memory range does exeed its boundaries
/// An index or memory range does exceed its boundaries
#[error("value out of bounds")]
OutOfBounds,
/// The size isn't valid
Expand Down
2 changes: 1 addition & 1 deletion src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ enum RuntimeEnvironmentSlot {
MemoryMapping = 28,
}

/* Explaination of the Instruction Meter
/* Explanation of the Instruction Meter

The instruction meter serves two purposes: First, measure how many BPF instructions are
executed (profiling) and second, limit this number by stopping the program with an exception
Expand Down
4 changes: 2 additions & 2 deletions src/memory_region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ use std::{
ptr::{self, copy_nonoverlapping},
};

/* Explaination of the Gapped Memory
/* Explanation of the Gapped Memory

The MemoryMapping supports a special mapping mode which is used for the stack MemoryRegion.
In this mode the backing address space of the host is sliced in power-of-two aligned frames.
The exponent of this alignment is specified in vm_gap_shift. Then the virtual address space
of the guest is spread out in a way which leaves gapes, the same size as the frames, in
between the frames. This effectively doubles the size of the guests virtual address space.
But the acutual mapped memory stays the same, as the gaps are not mapped and accessing them
But the actual mapped memory stays the same, as the gaps are not mapped and accessing them
results in an AccessViolation.

Guest: frame 0 | gap 0 | frame 1 | gap 1 | frame 2 | gap 2 | ...
Expand Down