Skip to content

Commit 343dcd4

Browse files
committed
Fix typos and technical inaccuracies in source files
Typos fixed: - 'fillint' -> 'filling' (stackman_switch.h) - 'wiht' -> 'with' (test.c, test_cc.cc) - 'ithout' -> 'without' (test_cc.cc) - 'stackpoiners' -> 'stack pointers' (test.c, test_cc.cc) - 'incle' -> 'include' (stackman_impl.h) - 'identif' -> 'identify' (README.md) - 'argments' -> 'arguments' (switch_x64_msvc.asm) - 'suffle' -> 'shuffle' (switch_x64_msvc.asm) - 'nonvolatile' -> 'non-volatile' (switch_x64_msvc.asm) Technical corrections: - 'callee-stored' -> 'callee-saved' (correct ABI terminology) - Fixed inconsistent comments in switch_template.h that said 'volatile registers' when describing non-volatile registers
1 parent 8bfcd7e commit 343dcd4

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ See `.github/workflows/buildcommit.yml` for the complete CI configuration.
179179
180180
### Adding new platforms
181181
182-
1. Modify `platform.h` to identif the platform environment. Define an ABI name and
182+
1. Modify `platform.h` to identify the platform environment. Define an ABI name and
183183
include custom header files.
184184
2. Use the `switch_template.h` to help build a `switch_ABI.h` file for your ABI.
185185
3. Provide an assembler version, `switch_ABI.S` by compiling the `gen_asm.c` file for your platform.

stackman/platforms/switch_template.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void *STACKMAN_SWITCH_INASM_NAME(stackman_cb_t callback, void *context)
3131
/* assembly to save non-volatile registers
3232
* those, according to abi, that functions must save/restore if they
3333
* intend to use them
34-
/* __asm__("push volatile registers") */
34+
/* __asm__("push non-volatile registers") */
3535

3636
/* sp = get stack pointer from assembly code */
3737
/* __asm__("get sp into stack_pointer") */
@@ -41,7 +41,7 @@ void *STACKMAN_SWITCH_INASM_NAME(stackman_cb_t callback, void *context)
4141
/* __asm__("store sp from stack_pointer") */
4242
stack_pointer = callback(context, STACKMAN_OP_RESTORE, stack_pointer);
4343
/* restore non-volatile registers from stack */
44-
/* __asm__("pop volatile registers") */
44+
/* __asm__("pop non-volatile registers") */
4545
return stack_pointer;
4646
}
4747

stackman/platforms/switch_x64_msvc.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ NESTED_ENTRY stackman_switch, _TEXT$00
4949
.allocstack 20h
5050
.endprolog
5151

52-
;save argments in nonvolatile registers
52+
;save arguments in non-volatile registers
5353
mov r12, rcx ;callback
5454
mov r13, rdx ;context
5555

@@ -111,7 +111,7 @@ stackman_call PROC FRAME
111111
.setframe rbp, 00h
112112
.endprolog
113113

114-
; suffle arguments into volatile registers
114+
; shuffle arguments into volatile registers
115115
mov rax, rcx ; callback
116116
mov rcx, rdx ; context into first arg
117117
mov r9, r8 ; and stack pointer in volatile registers

stackman/stackman_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* defines:
99
* STACKMAN_LINKAGE_STATIC - define to provide static linkage to stackman_switch()
1010
*
11-
* See also stackman.h for main incle api
11+
* See also stackman.h for main include api
1212
*/
1313

1414
#define STACKMAN_SWITCH_IMPL

stackman/stackman_switch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* stack pointer.
5656
*
5757
* The implementation must simply:
58-
* 1) store all platform and cpu state on the stack (callee-stored
58+
* 1) store all platform and cpu state on the stack (callee-saved
5959
* registers, exception state, etc)
6060
* 2) call the callback with the context, opcode STACKMAN_OP_SAVE and
6161
* the current stack pointer. This allows the application to do additional
@@ -92,7 +92,7 @@ typedef enum stackman_op_t {
9292
STACKMAN_OP_SAVE = 0,
9393

9494
/* The callback receives the new stack pointer and should restore
95-
* any state for it, e.g. fillint the stack with the correct data.
95+
* any state for it, e.g. filling the stack with the correct data.
9696
* what it returns will be the return value from stackman_switch().
9797
*/
9898
STACKMAN_OP_RESTORE = 1,

tests/test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
#define assert_align(p) assert((intptr_t)(p) == STACKMAN_SP_ALIGN(p))
1111

12-
/* simple test ithout modifying stack pointers.
13-
* test that the callback is called wiht valid
14-
* stackpoiners and the stage member in the
12+
/* simple test without modifying stack pointers.
13+
* test that the callback is called with valid
14+
* stack pointers and the stage member in the
1515
* correct order.
1616
*/
1717
typedef struct ctxt01

tests/test_cc.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <iostream>
77
using namespace std;
88

9-
/* simple test ithout modifying stack pointers.
10-
* test that the callback is called wiht valid
11-
* stackpoiners and the stage member in the
9+
/* simple test without modifying stack pointers.
10+
* test that the callback is called with valid
11+
* stack pointers and the stage member in the
1212
* correct order.
1313
*/
1414
typedef struct ctxt01

0 commit comments

Comments
 (0)