diff --git a/ChangeLog b/ChangeLog index d4bd9ac27..593cc4cf7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2000-10-10 OKUJI Yoshinori + + * stage2/start.S (copy_buffer): Use pusha and popa instead of + pushing and poping %di and %si individually, to reduce the code + size and save %cx as well. Reported by Herbert Nachtnebel + . + +2000-10-10 OKUJI Yoshinori + + From Daniel Pittman : + * stage2/builtins.c (setkey_func): Check if + KEYSYM_TABLE[I].UNSHIFTED_NAME and KEYSYM_TABLE[I].SHIFTED_NAME + are not NULLs, before calling grub_strcmp. + 2000-10-08 OKUJI Yoshinori * util/grub-install.in (grub_prefix): New variable. The default diff --git a/THANKS b/THANKS index 4f5e558b4..df14bc76e 100644 --- a/THANKS +++ b/THANKS @@ -15,6 +15,7 @@ Bryan Ford Chip Salzenberg Christoph Plattner Dan J. Walters +Daniel Pittman Daniel Wagner Edmund GRIMLEY EVANS Edward Killips @@ -23,6 +24,7 @@ Frank Mehnert Goran Koruga Hal Snyder Heiko Schroeder +Herbert Nachtnebel Hisazumi Kenji Jochen Hoenicke Johannes Kroeger diff --git a/stage2/builtins.c b/stage2/builtins.c index 60289b467..5eee56dfa 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -3182,24 +3182,28 @@ setkey_func (char *arg, int flags) for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++) { - if (grub_strcmp (key, keysym_table[i].unshifted_name) == 0) + if (keysym_table[i].unshifted_name && + grub_strcmp (key, keysym_table[i].unshifted_name) == 0) return keysym_table[i].keycode; - else if (grub_strcmp (key, keysym_table[i].shifted_name) == 0) + else if (keysym_table[i].shifted_name && + grub_strcmp (key, keysym_table[i].shifted_name) == 0) return keysym_table[i].keycode; } - + return 0; } - + static int find_ascii_code (char *key) { int i; - + for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++) { - if (grub_strcmp (key, keysym_table[i].unshifted_name) == 0) + if (keysym_table[i].unshifted_name && + grub_strcmp (key, keysym_table[i].unshifted_name) == 0) return keysym_table[i].unshifted_ascii; - else if (grub_strcmp (key, keysym_table[i].shifted_name) == 0) + else if (keysym_table[i].shifted_name && + grub_strcmp (key, keysym_table[i].shifted_name) == 0) return keysym_table[i].shifted_ascii; } @@ -3208,10 +3212,10 @@ setkey_func (char *arg, int flags) to_key = arg; from_key = skip_to (0, to_key); - + nul_terminate (to_key); nul_terminate (from_key); - + to_code = find_ascii_code (to_key); from_code = find_ascii_code (from_key); if (! to_code || ! from_code) @@ -3225,7 +3229,7 @@ setkey_func (char *arg, int flags) return 1; } } - + if (map_in_interrupt) { int i; @@ -3249,7 +3253,8 @@ setkey_func (char *arg, int flags) if (to_code == from_code) /* If TO is equal to FROM, delete the entry. */ - grub_memmove ((char *) &bios_key_map[i], (char *) &bios_key_map[i + 1], + grub_memmove ((char *) &bios_key_map[i], + (char *) &bios_key_map[i + 1], sizeof (unsigned short) * (KEY_MAP_SIZE - i)); else bios_key_map[i] = (to_code << 8) | from_code; diff --git a/stage2/start.S b/stage2/start.S index b96900d75..c0877757a 100644 --- a/stage2/start.S +++ b/stage2/start.S @@ -279,15 +279,14 @@ copy_buffer: addw %ax, 6(%di) /* add the corrected value to the destination address for next time */ + /* save addressing regs */ + pusha + pushw %ds + /* get the copy length */ shlw $4, %ax movw %ax, %cx - /* save addressing regs */ - pushw %si - pushw %di - pushw %ds - xorw %di, %di /* zero offset of destination addresses */ xorw %si, %si /* zero offset of source addresses */ movw %bx, %ds /* restore the source segment */ @@ -302,8 +301,7 @@ copy_buffer: (MSG modifies SI, which is saved, and unused AX and BX) */ popw %ds MSG(notification_step) - popw %di - popw %si + popa /* check if finished with this dataset */ cmpw $0, 4(%di)