diff options
| author | Ian Moffett <ian@osmora.org> | 2025-11-15 18:31:54 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-11-15 18:31:54 -0500 |
| commit | 7a1e4b743bc45dbd869eeb19eb262654225a090a (patch) | |
| tree | f96e280c1c126a6106a21730ddba8ff3bfd0ef4e /sys/arch/amd64/io/uart.S | |
| parent | ed12cadce8cd41e0097ed71e15f2b2e729dbbf87 (diff) | |
kern/amd64: io: Add uart_puts() helper for strings
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64/io/uart.S')
| -rw-r--r-- | sys/arch/amd64/io/uart.S | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/arch/amd64/io/uart.S b/sys/arch/amd64/io/uart.S index 8e190ed..b67527a 100644 --- a/sys/arch/amd64/io/uart.S +++ b/sys/arch/amd64/io/uart.S @@ -95,5 +95,36 @@ uart_write: .done: retq + .globl uart_puts +uart_puts: + /* + * void uart_puts(const char *s); + */ + + push %r12 + push %r13 + push %r14 + push %r15 + push %rbx + push %rbp + + mov %rsi, %rcx + mov %rdi, %rsi +.putsloop: + lodsb + or %al, %al + jz .putsdone + mov $UART_COM1, %dx + out %al, %dx + jmp .putsloop +.putsdone: + + pop %rbp + pop %rbx + pop %r15 + pop %r14 + pop %r13 + pop %r12 + /* vim: ft=gas : */ |
