Skip to content

Commit 64ab3d2

Browse files
committed
uefi: align debug protocol rustdoc
1 parent f9fd0f9 commit 64ab3d2

3 files changed

Lines changed: 165 additions & 109 deletions

File tree

uefi/src/proto/debug/context.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// note from the spec:
44
// When the context record field is larger than the register being stored in it, the upper bits of the
55
// context record field are unused and ignored
6-
/// Universal EFI_SYSTEM_CONTEXT definition
7-
/// This is passed to debug callbacks
6+
/// Architecture-dependent processor context passed to debug callbacks.
87
#[repr(C)]
98
#[expect(missing_debug_implementations)]
109
pub union SystemContext {
@@ -19,7 +18,7 @@ pub union SystemContext {
1918
aarch64: *mut SystemContextAARCH64,
2019
}
2120

22-
/// System context for virtual EBC processors
21+
/// Processor context for the UEFI bytecode interpreter.
2322
#[repr(C)]
2423
#[derive(Debug, Clone, Copy)]
2524
pub struct SystemContextEBC {
@@ -288,7 +287,7 @@ pub struct SystemContextIA32 {
288287
eax: u32,
289288
}
290289

291-
/// FP / MMX / XMM registers for IA-32
290+
/// Floating-point, MMX, and XMM registers for IA-32.
292291
#[repr(C)]
293292
#[derive(Debug, Clone, Copy)]
294293
pub struct FxSaveStateIA32 {
@@ -329,7 +328,7 @@ pub struct FxSaveStateIA32 {
329328
reserved_11: [u8; 14 * 16],
330329
}
331330

332-
/// System context for x64 processors
331+
/// Processor context for x86-64.
333332
#[repr(C)]
334333
#[derive(Debug, Clone, Copy)]
335334
pub struct SystemContextX64 {
@@ -377,7 +376,7 @@ pub struct SystemContextX64 {
377376
r15: u64,
378377
}
379378

380-
/// FP / MMX / XMM registers for X64
379+
/// Floating-point, MMX, and XMM registers for x86-64.
381380
#[repr(C)]
382381
#[derive(Debug, Clone, Copy)]
383382
pub struct FxSaveStateX64 {
@@ -543,7 +542,7 @@ pub struct SystemContextIPF {
543542
int_nat: u64, // nat bits for r1-r31
544543
}
545544

546-
/// System context for ARM processors
545+
/// Processor context for 32-bit ARM.
547546
#[repr(C)]
548547
#[derive(Debug, Clone, Copy)]
549548
pub struct SystemContextARM {
@@ -569,7 +568,7 @@ pub struct SystemContextARM {
569568
ifsr: u32,
570569
}
571570

572-
/// System context for AARCH64 processors
571+
/// Processor context for AArch64.
573572
#[repr(C)]
574573
#[derive(Debug, Clone, Copy)]
575574
pub struct SystemContextAARCH64 {

uefi/src/proto/debug/exception.rs

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -6,183 +6,183 @@
66
pub struct ExceptionType(isize);
77

88
impl ExceptionType {
9-
/// Undefined Exception
9+
/// Indicates an undefined EBC exception.
1010
pub const EXCEPT_EBC_UNDEFINED: Self = Self(0);
11-
/// Divide-by-zero Error
11+
/// Indicates an EBC divide-by-zero error.
1212
pub const EXCEPT_EBC_DIVIDE_ERROR: Self = Self(1);
13-
/// Debug Exception
13+
/// Indicates an EBC debug exception.
1414
pub const EXCEPT_EBC_DEBUG: Self = Self(2);
15-
/// Breakpoint
15+
/// Indicates an EBC breakpoint.
1616
pub const EXCEPT_EBC_BREAKPOINT: Self = Self(3);
17-
/// Overflow
17+
/// Indicates an EBC overflow.
1818
pub const EXCEPT_EBC_OVERFLOW: Self = Self(4);
19-
/// Invalid Opcode
19+
/// Indicates an invalid EBC opcode.
2020
pub const EXCEPT_EBC_INVALID_OPCODE: Self = Self(5);
21-
/// Stack-Segment Fault
21+
/// Indicates an EBC stack fault.
2222
pub const EXCEPT_EBC_STACK_FAULT: Self = Self(6);
23-
/// Alignment Check
23+
/// Indicates an EBC alignment check.
2424
pub const EXCEPT_EBC_ALIGNMENT_CHECK: Self = Self(7);
25-
/// Instruction Encoding Exception
25+
/// Indicates an EBC instruction-encoding exception.
2626
pub const EXCEPT_EBC_INSTRUCTION_ENCODING: Self = Self(8);
27-
/// Bad Breakpoint Exception
27+
/// Indicates an invalid EBC breakpoint.
2828
pub const EXCEPT_EBC_BAD_BREAK: Self = Self(9);
29-
/// Single Step Exception
29+
/// Indicates an EBC single-step exception.
3030
pub const EXCEPT_EBC_SINGLE_STEP: Self = Self(10);
3131
}
3232

3333
#[cfg(target_arch = "x86")]
3434
impl ExceptionType {
35-
/// Divide-by-zero Error
35+
/// Indicates a divide-by-zero error.
3636
pub const EXCEPT_IA32_DIVIDE_ERROR: Self = Self(0);
37-
/// Debug Exception
37+
/// Indicates a debug exception.
3838
pub const EXCEPT_IA32_DEBUG: Self = Self(1);
39-
/// Non-maskable Interrupt
39+
/// Indicates a non-maskable interrupt.
4040
pub const EXCEPT_IA32_NMI: Self = Self(2);
41-
/// Breakpoint
41+
/// Indicates a breakpoint.
4242
pub const EXCEPT_IA32_BREAKPOINT: Self = Self(3);
43-
/// Overflow
43+
/// Indicates an overflow.
4444
pub const EXCEPT_IA32_OVERFLOW: Self = Self(4);
45-
/// Bound Range Exceeded
45+
/// Indicates that a bound range was exceeded.
4646
pub const EXCEPT_IA32_BOUND: Self = Self(5);
47-
/// Invalid Opcode
47+
/// Indicates an invalid opcode.
4848
pub const EXCEPT_IA32_INVALID_OPCODE: Self = Self(6);
49-
/// Double Fault
49+
/// Indicates a double fault.
5050
pub const EXCEPT_IA32_DOUBLE_FAULT: Self = Self(8);
51-
/// Invalid TSS
51+
/// Indicates an invalid task-state segment.
5252
pub const EXCEPT_IA32_INVALID_TSS: Self = Self(10);
53-
/// Segment Not Present
53+
/// Indicates a missing segment.
5454
pub const EXCEPT_IA32_SEG_NOT_PRESENT: Self = Self(11);
55-
/// Stack-Segment Fault
55+
/// Indicates a stack-segment fault.
5656
pub const EXCEPT_IA32_STACK_FAULT: Self = Self(12);
57-
/// General Protection Fault
57+
/// Indicates a general-protection fault.
5858
pub const EXCEPT_IA32_GP_FAULT: Self = Self(13);
59-
/// Page Fault
59+
/// Indicates a page fault.
6060
pub const EXCEPT_IA32_PAGE_FAULT: Self = Self(14);
61-
/// x87 Floating-Point Exception
61+
/// Indicates an x87 floating-point exception.
6262
pub const EXCEPT_IA32_FP_ERROR: Self = Self(16);
63-
/// Alignment Check
63+
/// Indicates an alignment check.
6464
pub const EXCEPT_IA32_ALIGNMENT_CHECK: Self = Self(17);
65-
/// Machine Check
65+
/// Indicates a machine check.
6666
pub const EXCEPT_IA32_MACHINE_CHECK: Self = Self(18);
67-
/// SIMD Floating-Point Exception
67+
/// Indicates a SIMD floating-point exception.
6868
pub const EXCEPT_IA32_SIMD: Self = Self(19);
6969
}
7070

7171
#[cfg(target_arch = "x86_64")]
7272
impl ExceptionType {
73-
/// Divide-by-zero Error
73+
/// Indicates a divide-by-zero error.
7474
pub const EXCEPT_X64_DIVIDE_ERROR: Self = Self(0);
75-
/// Debug Exception
75+
/// Indicates a debug exception.
7676
pub const EXCEPT_X64_DEBUG: Self = Self(1);
77-
/// Non-maskable Interrupt
77+
/// Indicates a non-maskable interrupt.
7878
pub const EXCEPT_X64_NMI: Self = Self(2);
79-
/// Breakpoint
79+
/// Indicates a breakpoint.
8080
pub const EXCEPT_X64_BREAKPOINT: Self = Self(3);
81-
/// Overflow
81+
/// Indicates an overflow.
8282
pub const EXCEPT_X64_OVERFLOW: Self = Self(4);
83-
/// Bound Range Exceeded
83+
/// Indicates that a bound range was exceeded.
8484
pub const EXCEPT_X64_BOUND: Self = Self(5);
85-
/// Invalid Opcode
85+
/// Indicates an invalid opcode.
8686
pub const EXCEPT_X64_INVALID_OPCODE: Self = Self(6);
87-
/// Double Fault
87+
/// Indicates a double fault.
8888
pub const EXCEPT_X64_DOUBLE_FAULT: Self = Self(8);
89-
/// Invalid TSS
89+
/// Indicates an invalid task-state segment.
9090
pub const EXCEPT_X64_INVALID_TSS: Self = Self(10);
91-
/// Segment Not Present
91+
/// Indicates a missing segment.
9292
pub const EXCEPT_X64_SEG_NOT_PRESENT: Self = Self(11);
93-
/// Stack-Segment Fault
93+
/// Indicates a stack-segment fault.
9494
pub const EXCEPT_X64_STACK_FAULT: Self = Self(12);
95-
/// General Protection Fault
95+
/// Indicates a general-protection fault.
9696
pub const EXCEPT_X64_GP_FAULT: Self = Self(13);
97-
/// Page Fault
97+
/// Indicates a page fault.
9898
pub const EXCEPT_X64_PAGE_FAULT: Self = Self(14);
99-
/// x87 Floating-Point Exception
99+
/// Indicates an x87 floating-point exception.
100100
pub const EXCEPT_X64_FP_ERROR: Self = Self(16);
101-
/// Alignment Check
101+
/// Indicates an alignment check.
102102
pub const EXCEPT_X64_ALIGNMENT_CHECK: Self = Self(17);
103-
/// Machine Check
103+
/// Indicates a machine check.
104104
pub const EXCEPT_X64_MACHINE_CHECK: Self = Self(18);
105-
/// SIMD Floating-Point Exception
105+
/// Indicates a SIMD floating-point exception.
106106
pub const EXCEPT_X64_SIMD: Self = Self(19);
107107
}
108108

109109
#[cfg(target_arch = "arm")]
110110
impl ExceptionType {
111-
/// Processor reset
111+
/// Indicates a processor reset.
112112
pub const EXCEPT_ARM_RESET: Self = Self(0);
113-
/// Undefined instruction
113+
/// Indicates an undefined instruction.
114114
pub const EXCEPT_ARM_UNDEFINED_INSTRUCTION: Self = Self(1);
115-
/// Software Interrupt
115+
/// Indicates a software interrupt.
116116
pub const EXCEPT_ARM_SOFTWARE_INTERRUPT: Self = Self(2);
117-
/// Prefetch aborted
117+
/// Indicates an aborted prefetch.
118118
pub const EXCEPT_ARM_PREFETCH_ABORT: Self = Self(3);
119-
/// Data access memory abort
119+
/// Indicates a data-access memory abort.
120120
pub const EXCEPT_ARM_DATA_ABORT: Self = Self(4);
121-
/// Reserved
121+
/// Represents the reserved exception value.
122122
pub const EXCEPT_ARM_RESERVED: Self = Self(5);
123-
/// Normal interrupt
123+
/// Indicates a normal interrupt.
124124
pub const EXCEPT_ARM_IRQ: Self = Self(6);
125-
/// Fast interrupt
125+
/// Indicates a fast interrupt.
126126
pub const EXCEPT_ARM_FIQ: Self = Self(7);
127-
/// In the UEFI spec for "convenience", unsure if we'll need it. Set to `EXCEPT_ARM_FIQ`
127+
/// Provides the maximum ARM exception value defined by UEFI.
128128
pub const MAX_ARM_EXCEPTION: Self = Self::EXCEPT_ARM_FIQ;
129129
}
130130

131131
#[cfg(target_arch = "aarch64")]
132132
impl ExceptionType {
133-
/// Synchronous exception, such as attempting to execute an invalid instruction
133+
/// Indicates a synchronous exception, such as an invalid instruction.
134134
pub const EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS: Self = Self(0);
135-
/// Normal interrupt
135+
/// Indicates a normal interrupt.
136136
pub const EXCEPT_AARCH64_IRQ: Self = Self(1);
137-
/// Fast interrupt
137+
/// Indicates a fast interrupt.
138138
pub const EXCEPT_AARCH64_FIQ: Self = Self(2);
139-
/// System Error
139+
/// Indicates a system error.
140140
pub const EXCEPT_AARCH64_SERROR: Self = Self(3);
141-
/// In the UEFI spec for "convenience", unsure if we'll need it. Set to `EXCEPT_AARCH64_SERROR`
141+
/// Provides the maximum AArch64 exception value defined by UEFI.
142142
pub const MAX_AARCH64_EXCEPTION: Self = Self::EXCEPT_AARCH64_SERROR;
143143
}
144144

145145
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
146146
impl ExceptionType {
147-
/// Instruction misaligned
147+
/// Indicates a misaligned instruction address.
148148
pub const EXCEPT_RISCV_INST_MISALIGNED: Self = Self(0);
149-
/// Instruction access fault
149+
/// Indicates an instruction-access fault.
150150
pub const EXCEPT_RISCV_INST_ACCESS_FAULT: Self = Self(1);
151-
/// Illegal instruction
151+
/// Indicates an illegal instruction.
152152
pub const EXCEPT_RISCV_ILLEGAL_INST: Self = Self(2);
153-
/// Breakpoint
153+
/// Indicates a breakpoint.
154154
pub const EXCEPT_RISCV_BREAKPOINT: Self = Self(3);
155-
/// Load address misaligned
155+
/// Indicates a misaligned load address.
156156
pub const EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED: Self = Self(4);
157-
/// Load accept fault
157+
/// Indicates a load-access fault.
158158
pub const EXCEPT_RISCV_LOAD_ACCESS_FAULT: Self = Self(5);
159-
/// Store AMO address misaligned
159+
/// Indicates a misaligned store or AMO address.
160160
pub const EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED: Self = Self(6);
161-
/// Store AMO access fault
161+
/// Indicates a store or AMO access fault.
162162
pub const EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT: Self = Self(7);
163-
/// ECALL from User mode
163+
/// Indicates an environment call from user mode.
164164
pub const EXCEPT_RISCV_ENV_CALL_FROM_UMODE: Self = Self(8);
165-
/// ECALL from Supervisor mode
165+
/// Indicates an environment call from supervisor mode.
166166
pub const EXCEPT_RISCV_ENV_CALL_FROM_SMODE: Self = Self(9);
167-
/// ECALL from Machine mode
167+
/// Indicates an environment call from machine mode.
168168
pub const EXCEPT_RISCV_ENV_CALL_FROM_MMODE: Self = Self(11);
169-
/// Instruction page fault
169+
/// Indicates an instruction page fault.
170170
pub const EXCEPT_RISCV_INST_PAGE_FAULT: Self = Self(12);
171-
/// Load page fault
171+
/// Indicates a load page fault.
172172
pub const EXCEPT_RISCV_LOAD_PAGE_FAULT: Self = Self(13);
173-
/// Store AMO page fault
173+
/// Indicates a store or AMO page fault.
174174
pub const EXCEPT_RISCV_STORE_AMO_PAGE_FAULT: Self = Self(15);
175175
// RISC-V interrupt types
176-
/// Supervisor software interrupt
176+
/// Indicates a supervisor software interrupt.
177177
pub const EXCEPT_RISCV_SUPERVISOR_SOFTWARE_INT: Self = Self(1);
178-
/// Machine software interrupt
178+
/// Indicates a machine software interrupt.
179179
pub const EXCEPT_RISCV_MACHINE_SOFTWARE_INT: Self = Self(3);
180-
/// Supervisor timer interrupt
180+
/// Indicates a supervisor timer interrupt.
181181
pub const EXCEPT_RISCV_SUPERVISOR_TIMER_INT: Self = Self(5);
182-
/// Machine timer interrupt
182+
/// Indicates a machine timer interrupt.
183183
pub const EXCEPT_RISCV_MACHINE_TIMER_INT: Self = Self(7);
184-
/// Supervisor external interrupt
184+
/// Indicates a supervisor external interrupt.
185185
pub const EXCEPT_RISCV_SUPERVISOR_EXTERNAL_INT: Self = Self(9);
186-
/// Machine external interrupt
186+
/// Indicates a machine external interrupt.
187187
pub const EXCEPT_RISCV_MACHINE_EXTERNAL_INT: Self = Self(11);
188188
}

0 commit comments

Comments
 (0)