aboutsummaryrefslogtreecommitdiff
path: root/src/libs
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-05-04 15:30:24 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-05-04 15:30:24 +0200
commit1530a85d5aefcf6497ff2129023e9a0b002603dd (patch)
treeea6098d0dcafabba0ffc2f28ea5c136f731996b9 /src/libs
parent64a17f3e0683a0a492a3fed9c4c17a4335d1f421 (diff)
Solving many issues: Aligning kernel stack, improve syscall mechanism,
DISABLING RED-ZONE !!!!
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/stdio.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libs/stdio.cc b/src/libs/stdio.cc
index 3770cd3..e29f2cc 100644
--- a/src/libs/stdio.cc
+++ b/src/libs/stdio.cc
@@ -8,13 +8,13 @@ void (*__putchar)(char)=memtext_putchar;
void printf(char *str,...) {
u64 rsi,rdx,rcx,r8,r9;
u64* rbp;
- asm( "mov %%rsi, %0": "=a"(rsi));
- asm( "mov %%rdx, %0": "=a"(rdx));
- asm( "mov %%rcx, %0": "=a"(rcx));
- asm( "mov %%r8, %0": "=a"(r8));
- asm( "mov %%r9, %0": "=a"(r9));
- asm( "mov %%rbp, %0": "=a"(rbp));
-
+ asm volatile( "mov %%rsi, %0": "=m"(rsi));
+ asm volatile( "mov %%rdx, %0": "=m"(rdx));
+ asm volatile( "mov %%rcx, %0": "=m"(rcx));
+ asm volatile( "mov %%r8, %0": "=m"(r8));
+ asm volatile( "mov %%r9, %0": "=m"(r9));
+ asm volatile( "mov %%rbp, %0": "=m"(rbp));
+
// Init informations
int len=strlen(str);
int i=0; // Pointer to the current character