summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--com32/include/klibc/compiler.h11
-rw-r--r--core/parseconfig.inc9
-rw-r--r--core/ui.inc16
3 files changed, 27 insertions, 9 deletions
diff --git a/com32/include/klibc/compiler.h b/com32/include/klibc/compiler.h
index 9f5d36e2..2b8e0f6e 100644
--- a/com32/include/klibc/compiler.h
+++ b/com32/include/klibc/compiler.h
@@ -94,11 +94,11 @@
/* likely/unlikely */
#if defined(__GNUC__) && (__GNUC_MAJOR__ > 2 || (__GNUC_MAJOR__ == 2 && __GNUC_MINOR__ >= 95))
-# define __likely(x) __builtin_expect((x), 1)
-# define __unlikely(x) __builtin_expect((x), 0)
+# define __likely(x) __builtin_expect(!!(x), 1)
+# define __unlikely(x) __builtin_expect(!!(x), 0)
#else
-# define __likely(x) (x)
-# define __unlikely(x) (x)
+# define __likely(x) (!!(x))
+# define __unlikely(x) (!!(x))
#endif
/* Possibly unused function */
@@ -115,6 +115,9 @@
/* Packed structures */
#define __packed __attribute__((packed))
+/* Weak symbols */
+#define __weak __attribute__((weak))
+
/* Alignment */
#define __aligned(x) __attribute__((aligned(x)))
#define __alignas(x) __attribute__((aligned(__alignof__(x))))
diff --git a/core/parseconfig.inc b/core/parseconfig.inc
index 7fb6ddf9..4a38c35d 100644
--- a/core/parseconfig.inc
+++ b/core/parseconfig.inc
@@ -307,7 +307,14 @@ pc_label: call commit_vk ; Commit any current vkernel
rep stosw
call pc_getline
mov di,VKernelBuf+vk_vname
- call mangle_name ; Mangle virtual name
+ mov cx,FILENAME_MAX-1
+.loop:
+ lodsb
+ cmp al,' '
+ jna .done
+ stosb
+ loop .loop
+.done:
mov byte [VKernel],1 ; We've seen a "label" statement
mov si,VKernelBuf+vk_vname ; By default, rname == vname
mov di,VKernelBuf+vk_rname
diff --git a/core/ui.inc b/core/ui.inc
index f593ce10..26b6fa09 100644
--- a/core/ui.inc
+++ b/core/ui.inc
@@ -308,12 +308,20 @@ vk_check:
sub di,cx ; Return to beginning of buf
push si
- mov si,KernelName
- mov cx,FILENAME_MAX
- es repe cmpsb
+ mov si,command_line
+.loop:
+ lodsb
+ cmp al,' '
+ jbe .done
+ scasb
+ je .loop
+.nomatch:
pop si
- je .found
jmp .scan
+.done:
+ cmp byte [di],0 ; Must match end of string
+ jne .nomatch
+ pop si
;
; We *are* using a "virtual kernel"