diff options
author | Marvin Borner | 2021-02-22 19:55:49 +0100 |
---|---|---|
committer | Marvin Borner | 2021-02-22 19:55:49 +0100 |
commit | 4c527e07fff9ed0a1eb0f34f1abd943706a0dba1 (patch) | |
tree | c42bea979caf39459287fb02b4d6fb6f6c05473e /libc | |
parent | 2d45d21f4b386fc3453fcee279dfd7d9931fe90d (diff) |
Some improvements
Diffstat (limited to 'libc')
-rw-r--r-- | libc/cpu.c | 2 | ||||
-rw-r--r-- | libc/mem.c | 30 |
2 files changed, 16 insertions, 16 deletions
@@ -113,7 +113,7 @@ void fpu_restore(void) void cpu_enable_features(void) { - u32 a = 0, b = 0, c = 0, d = 0; + u32 a, b, c, d; cpuid(CPUID_FEATURES, &a, &b, &c, &d); cpu_features = d; if (cpu_has_feature(CPUID_FEAT_EDX_SSE)) { @@ -10,10 +10,10 @@ void *memcpy(void *dest, const void *src, u32 n) #ifdef userspace // Inspired by Jeko at osdev for (u32 i = 0; i < n / 16; i++) { - __asm__ __volatile__("movups (%0), %%xmm0\n" - "movntdq %%xmm0, (%1)\n" ::"r"(src), - "r"(dest) - : "memory"); + __asm__ volatile("movups (%0), %%xmm0\n" + "movntdq %%xmm0, (%1)\n" ::"r"(src), + "r"(dest) + : "memory"); src = ((u8 *)src) + 16; dest = ((u8 *)dest) + 16; @@ -23,17 +23,17 @@ void *memcpy(void *dest, const void *src, u32 n) n = n & 7; int d0, d1, d2; - __asm__ __volatile__("rep ; movsl\n\t" - "testb $2,%b4\n\t" - "je 1f\n\t" - "movsw\n" - "1:\ttestb $1,%b4\n\t" - "je 2f\n\t" - "movsb\n" - "2:" - : "=&c"(d0), "=&D"(d1), "=&S"(d2) - : "0"(n / 4), "q"(n), "1"((long)dest), "2"((long)src) - : "memory"); + __asm__ volatile("rep ; movsl\n\t" + "testb $2,%b4\n\t" + "je 1f\n\t" + "movsw\n" + "1:\ttestb $1,%b4\n\t" + "je 2f\n\t" + "movsb\n" + "2:" + : "=&c"(d0), "=&D"(d1), "=&S"(d2) + : "0"(n / 4), "q"(n), "1"((long)dest), "2"((long)src) + : "memory"); } return dest; #else |