diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-07-31 17:34:00 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-07-31 17:34:00 -0700 |
commit | b4bf076bd5a5ba6ed8f3b7f70cd1c2a0544a8502 (patch) | |
tree | 2969018166114aa4baa510881824c0a0dc607a7c | |
parent | e3e9dd535d53299b475fa8f495cbfdb4c8a5e292 (diff) | |
parent | ba5ae24cd489d6ea2d1ff2e39951c02a39a97315 (diff) | |
download | syslinux-b4bf076bd5a5ba6ed8f3b7f70cd1c2a0544a8502.tar.gz |
Merge commit 'origin/for-3.72'
-rw-r--r-- | com32/include/klibc/compiler.h | 11 | ||||
-rw-r--r-- | core/parseconfig.inc | 9 | ||||
-rw-r--r-- | core/ui.inc | 16 |
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" |