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 wrong inline assembly code in nop_putc. #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion src/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ int nop_putc(int c) {
// truly in a0, for easier post-processing, and so there is a single
// 32-bit opcode to match against.
// So explicitly ensure that the argument is placed into a0 first.
__asm__ volatile("mv a0, %0; slli x0,a0,0x11" ::"r"(c));
register long xc asm("a0") = c;
__asm__ volatile("slli x0,a0,0x11" ::"r"(xc));
return -1;
}
int metal_tty_putc(int c) __attribute__((weak, alias("nop_putc")));
Expand Down