diff options
Diffstat (limited to 'arch/x86/machine/boot.c')
-rw-r--r-- | arch/x86/machine/boot.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/arch/x86/machine/boot.c b/arch/x86/machine/boot.c index 63fcaf0a..76fbcb40 100644 --- a/arch/x86/machine/boot.c +++ b/arch/x86/machine/boot.c @@ -137,7 +137,9 @@ boot_memcpy(void *dest, const void *src, size_t n) src_ptr = src; for (i = 0; i < n; i++) { - *dest_ptr++ = *src_ptr++; + *dest_ptr = *src_ptr; + dest_ptr++; + src_ptr++; } return dest; @@ -155,14 +157,18 @@ boot_memmove(void *dest, const void *src, size_t n) src_ptr = src; for (i = 0; i < n; i++) { - *dest_ptr++ = *src_ptr++; + *dest_ptr = *src_ptr; + dest_ptr++; + src_ptr++; } } else { dest_ptr = dest + n - 1; src_ptr = src + n - 1; for (i = 0; i < n; i++) { - *dest_ptr-- = *src_ptr--; + *dest_ptr = *src_ptr; + dest_ptr--; + src_ptr--; } } @@ -187,15 +193,15 @@ boot_memset(void *s, int c, size_t n) size_t __boot boot_strlen(const char *s) { - size_t i; + const char *start; - i = 0; + start = s; - while (*s++ != '\0') { - i++; + while (*s != '\0') { + s++; } - return i; + return (s - start); } void __boot @@ -210,17 +216,22 @@ boot_panic(const char *msg) s = boot_panic_intro_msg; while ((ptr < end) && (*s != '\0')) { - *ptr++ = (BOOT_CGACOLOR << 8) | *s++; + *ptr = (BOOT_CGACOLOR << 8) | *s; + ptr++; + s++; } s = msg; while ((ptr < end) && (*s != '\0')) { - *ptr++ = (BOOT_CGACOLOR << 8) | *s++; + *ptr = (BOOT_CGACOLOR << 8) | *s; + ptr++; + s++; } while (ptr < end) { - *ptr++ = (BOOT_CGACOLOR << 8) | ' '; + *ptr = (BOOT_CGACOLOR << 8) | ' '; + ptr++; } cpu_halt(); |