remove all trailing whitespace
This commit is contained in:
parent
d2d4966571
commit
b39f9d20a9
222 changed files with 3286 additions and 3286 deletions
|
@ -56,7 +56,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
|
|||
|
||||
if (i == e->e_shnum)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found");
|
||||
|
||||
|
||||
symtab = (Elf32_Sym *) ((char *) e + s->sh_offset);
|
||||
entsize = s->sh_entsize;
|
||||
|
||||
|
@ -75,7 +75,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
|
|||
if (seg)
|
||||
{
|
||||
Elf32_Rel *rel, *max;
|
||||
|
||||
|
||||
for (rel = (Elf32_Rel *) ((char *) e + s->sh_offset),
|
||||
max = rel + s->sh_size / s->sh_entsize;
|
||||
rel < max;
|
||||
|
@ -83,15 +83,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
|
|||
{
|
||||
Elf32_Word *addr;
|
||||
Elf32_Sym *sym;
|
||||
|
||||
|
||||
if (seg->size < rel->r_offset)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
"reloc offset is out of the segment");
|
||||
|
||||
|
||||
addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset);
|
||||
sym = (Elf32_Sym *) ((char *) symtab
|
||||
+ entsize * ELF32_R_SYM (rel->r_info));
|
||||
|
||||
|
||||
switch (ELF32_R_TYPE (rel->r_info))
|
||||
{
|
||||
case R_386_32:
|
||||
|
|
|
@ -25,7 +25,7 @@ grub_stop_floppy (void)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
grub_arch_sync_caches (void *address __attribute__ ((unused)),
|
||||
grub_size_t len __attribute__ ((unused)))
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ static int num_regions;
|
|||
grub_addr_t grub_os_area_addr;
|
||||
grub_size_t grub_os_area_size;
|
||||
|
||||
void
|
||||
void
|
||||
grub_arch_sync_caches (void *address __attribute__ ((unused)),
|
||||
grub_size_t len __attribute__ ((unused)))
|
||||
{
|
||||
|
@ -64,20 +64,20 @@ make_install_device (void)
|
|||
to the boot drive. */
|
||||
if (grub_root_drive == 0xFF)
|
||||
grub_root_drive = grub_boot_drive;
|
||||
|
||||
|
||||
grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f',
|
||||
grub_root_drive & 0x7f);
|
||||
|
||||
|
||||
if (grub_install_dos_part >= 0)
|
||||
grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1);
|
||||
|
||||
|
||||
if (grub_install_bsd_part >= 0)
|
||||
grub_sprintf (dev + grub_strlen (dev), ",%c", grub_install_bsd_part + 'a');
|
||||
|
||||
|
||||
grub_sprintf (dev + grub_strlen (dev), ")%s", grub_prefix);
|
||||
grub_strcpy (grub_prefix, dev);
|
||||
}
|
||||
|
||||
|
||||
return grub_prefix;
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ compact_mem_regions (void)
|
|||
if (mem_regions[i].addr + mem_regions[i].size >= mem_regions[i + 1].addr)
|
||||
{
|
||||
j = i + 1;
|
||||
|
||||
|
||||
if (mem_regions[i].addr + mem_regions[i].size
|
||||
< mem_regions[j].addr + mem_regions[j].size)
|
||||
mem_regions[i].size = (mem_regions[j].addr + mem_regions[j].size
|
||||
|
@ -133,12 +133,12 @@ grub_machine_init (void)
|
|||
{
|
||||
int i;
|
||||
int grub_lower_mem;
|
||||
|
||||
|
||||
/* Initialize the console as early as possible. */
|
||||
grub_console_init ();
|
||||
|
||||
|
||||
grub_lower_mem = grub_get_memsize (0) << 10;
|
||||
|
||||
|
||||
/* Sanity check. */
|
||||
if (grub_lower_mem < GRUB_MEMORY_MACHINE_RESERVED_END)
|
||||
grub_fatal ("too small memory");
|
||||
|
@ -157,7 +157,7 @@ grub_machine_init (void)
|
|||
add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END,
|
||||
grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END);
|
||||
#endif
|
||||
|
||||
|
||||
auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t);
|
||||
int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type)
|
||||
{
|
||||
|
@ -166,16 +166,16 @@ grub_machine_init (void)
|
|||
{
|
||||
if (size <= 0x100000 - addr)
|
||||
return 0;
|
||||
|
||||
|
||||
size -= 0x100000 - addr;
|
||||
addr = 0x100000;
|
||||
}
|
||||
|
||||
|
||||
/* Ignore >4GB. */
|
||||
if (addr <= 0xFFFFFFFF && type == GRUB_MACHINE_MEMORY_AVAILABLE)
|
||||
{
|
||||
grub_size_t len;
|
||||
|
||||
|
||||
len = (grub_size_t) ((addr + size > 0xFFFFFFFF)
|
||||
? 0xFFFFFFFF - addr
|
||||
: size);
|
||||
|
@ -186,7 +186,7 @@ grub_machine_init (void)
|
|||
}
|
||||
|
||||
grub_machine_mmap_iterate (hook);
|
||||
|
||||
|
||||
compact_mem_regions ();
|
||||
|
||||
/* Add the memory regions to free memory, except for the region starting
|
||||
|
@ -204,7 +204,7 @@ grub_machine_init (void)
|
|||
}
|
||||
else
|
||||
grub_mm_init_region ((void *) mem_regions[i].addr, mem_regions[i].size);
|
||||
|
||||
|
||||
if (! grub_os_area_addr)
|
||||
grub_fatal ("no upper memory");
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This code was stolen from the files enter.sh, leave.sh, lzo1x_d.sh,
|
||||
* lzo1x_f.s and lzo_asm.h in LZO version 1.08, and was heavily modified
|
||||
|
@ -37,7 +37,7 @@
|
|||
#define MOVSL(r1,r2,x) movl (r1), x ; addl $4, r1 ; movl x, (r2) ; addl $4, r2
|
||||
#define COPYL_C(r1,r2,x,rc) 9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b
|
||||
#define COPYL(r1,r2,x) COPYL_C(r1,r2,x,%ecx)
|
||||
|
||||
|
||||
lzo1x_decompress:
|
||||
pushl %ebp
|
||||
pushl %edi
|
||||
|
@ -50,7 +50,7 @@ lzo1x_decompress:
|
|||
movl OUTP, %edi
|
||||
movl $3, %ebp
|
||||
|
||||
|
||||
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %ebx /* high bits 9-32 stay 0 */
|
||||
lodsb
|
||||
|
@ -283,7 +283,7 @@ lzo1x_decompress:
|
|||
.L_leave:
|
||||
negl %eax
|
||||
jnz 1f
|
||||
|
||||
|
||||
subl OUTP, %edi /* write back the uncompressed size */
|
||||
movl %edi, %eax
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uin
|
|||
grub_uint32_t cont;
|
||||
struct grub_machine_mmap_entry *entry
|
||||
= (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
|
||||
|
||||
|
||||
/* Check if grub_get_mmap_entry works. */
|
||||
cont = grub_get_mmap_entry (entry, 0);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Note: These functions defined in this file may be called from C.
|
||||
* Be careful of that you must not modify some registers. Quote
|
||||
* from gcc-2.95.2/gcc/config/i386/i386.h:
|
||||
|
||||
|
||||
1 for registers not available across function calls.
|
||||
These must include the FIXED_REGISTERS and also any
|
||||
registers that can be used without being saved.
|
||||
|
@ -52,9 +52,9 @@
|
|||
#include <grub/term.h>
|
||||
#include <multiboot.h>
|
||||
#include <multiboot2.h>
|
||||
|
||||
|
||||
#define ABS(x) ((x) - _start + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)
|
||||
|
||||
|
||||
.file "startup.S"
|
||||
|
||||
.text
|
||||
|
@ -140,7 +140,7 @@ multiboot_header:
|
|||
.long 0
|
||||
/* entry addr */
|
||||
.long multiboot_entry - _start + 0x100000 + 0x200
|
||||
|
||||
|
||||
multiboot_entry:
|
||||
.code32
|
||||
/* obtain the boot device */
|
||||
|
@ -157,7 +157,7 @@ multiboot_entry:
|
|||
/* jump to the real address */
|
||||
movl $multiboot_trampoline, %eax
|
||||
jmp *%eax
|
||||
|
||||
|
||||
multiboot_trampoline:
|
||||
/* fill the boot information */
|
||||
movl %edx, %eax
|
||||
|
@ -178,7 +178,7 @@ multiboot_trampoline:
|
|||
/* enter the usual booting */
|
||||
call prot_to_real
|
||||
.code16
|
||||
|
||||
|
||||
/* the real mode code continues... */
|
||||
codestart:
|
||||
cli /* we're not safe here! */
|
||||
|
@ -201,7 +201,7 @@ codestart:
|
|||
|
||||
/* reset disk system (%ah = 0) */
|
||||
int $0x13
|
||||
|
||||
|
||||
/* transition to protected mode */
|
||||
DATA32 call real_to_prot
|
||||
|
||||
|
@ -210,7 +210,7 @@ codestart:
|
|||
|
||||
incl %eax
|
||||
call EXT_C(grub_gate_a20)
|
||||
|
||||
|
||||
#if defined(ENABLE_LZO)
|
||||
/* decompress the compressed part and put the result at 1MB */
|
||||
movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %esi
|
||||
|
@ -260,7 +260,7 @@ codestart:
|
|||
rep
|
||||
movsb
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef APPLE_CC
|
||||
/* clean out the bss */
|
||||
bss_start_abs = ABS (bss_start)
|
||||
|
@ -279,13 +279,13 @@ codestart:
|
|||
movl $END_SYMBOL, %ecx
|
||||
subl %edi, %ecx
|
||||
#endif
|
||||
|
||||
|
||||
/* clean out */
|
||||
xorl %eax, %eax
|
||||
cld
|
||||
rep
|
||||
stosb
|
||||
|
||||
|
||||
/*
|
||||
* Call the start of main body of C code.
|
||||
*/
|
||||
|
@ -304,7 +304,7 @@ VARIABLE(grub_root_drive)
|
|||
.byte 0
|
||||
|
||||
.p2align 2 /* force 4-byte alignment */
|
||||
|
||||
|
||||
/*
|
||||
* These next two routines, "real_to_prot" and "prot_to_real" are structured
|
||||
* in a very specific way. Be very careful when changing them.
|
||||
|
@ -375,7 +375,7 @@ protcseg:
|
|||
FUNCTION(grub_gate_a20)
|
||||
movl %eax, %edx
|
||||
|
||||
gate_a20_test_current_state:
|
||||
gate_a20_test_current_state:
|
||||
/* first of all, test if already in a good state */
|
||||
call gate_a20_check_state
|
||||
cmpb %al, %dl
|
||||
|
@ -402,7 +402,7 @@ gate_a20_try_bios:
|
|||
cmpb %al, %dl
|
||||
jnz gate_a20_try_system_control_port_a
|
||||
ret
|
||||
|
||||
|
||||
gate_a20_try_system_control_port_a:
|
||||
/*
|
||||
* In macbook, the keyboard test would hang the machine, so we move
|
||||
|
@ -430,7 +430,7 @@ gate_a20_flush_keyboard_buffer:
|
|||
inb $0x64
|
||||
andb $0x02, %al
|
||||
jnz gate_a20_flush_keyboard_buffer
|
||||
2:
|
||||
2:
|
||||
inb $0x64
|
||||
andb $0x01, %al
|
||||
jz 3f
|
||||
|
@ -438,14 +438,14 @@ gate_a20_flush_keyboard_buffer:
|
|||
jmp 2b
|
||||
3:
|
||||
ret
|
||||
|
||||
gate_a20_try_keyboard_controller:
|
||||
|
||||
gate_a20_try_keyboard_controller:
|
||||
/* third, try the keyboard controller */
|
||||
call gate_a20_flush_keyboard_buffer
|
||||
|
||||
movb $0xd1, %al
|
||||
outb $0x64
|
||||
4:
|
||||
4:
|
||||
inb $0x64
|
||||
andb $0x02, %al
|
||||
jnz 4b
|
||||
|
@ -467,18 +467,18 @@ gate_a20_try_keyboard_controller:
|
|||
/* everything failed, so restart from the beginning */
|
||||
jnz gate_a20_try_bios
|
||||
ret
|
||||
|
||||
|
||||
gate_a20_check_state:
|
||||
/* iterate the checking for a while */
|
||||
movl $100, %ecx
|
||||
1:
|
||||
1:
|
||||
call 3f
|
||||
cmpb %al, %dl
|
||||
jz 2f
|
||||
loop 1b
|
||||
2:
|
||||
ret
|
||||
3:
|
||||
3:
|
||||
pushl %ebx
|
||||
pushl %ecx
|
||||
xorl %eax, %eax
|
||||
|
@ -567,7 +567,7 @@ FUNCTION(grub_exit)
|
|||
int $0x18
|
||||
jmp cold_reboot
|
||||
.code32
|
||||
|
||||
|
||||
/*
|
||||
* grub_reboot()
|
||||
*
|
||||
|
@ -576,13 +576,13 @@ FUNCTION(grub_exit)
|
|||
FUNCTION(grub_reboot)
|
||||
call prot_to_real
|
||||
.code16
|
||||
cold_reboot:
|
||||
cold_reboot:
|
||||
/* cold boot */
|
||||
movw $0x0472, %di
|
||||
movw %ax, (%di)
|
||||
ljmp $0xFFFF, $0x0000
|
||||
.code32
|
||||
|
||||
|
||||
/*
|
||||
* grub_halt(int no_apm)
|
||||
*
|
||||
|
@ -596,7 +596,7 @@ FUNCTION(grub_halt)
|
|||
|
||||
call prot_to_real
|
||||
.code16
|
||||
|
||||
|
||||
/* detect APM */
|
||||
movw $0x5300, %ax
|
||||
xorw %bx, %bx
|
||||
|
@ -621,7 +621,7 @@ FUNCTION(grub_halt)
|
|||
movw $0x0101, %cx
|
||||
int $0x15
|
||||
jc EXT_C(grub_hard_stop)
|
||||
|
||||
|
||||
/* set the power state to off */
|
||||
movw $0x5307, %ax
|
||||
movw $1, %bx
|
||||
|
@ -631,8 +631,8 @@ FUNCTION(grub_halt)
|
|||
/* shouldn't reach here */
|
||||
jmp EXT_C(grub_hard_stop)
|
||||
.code32
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* void grub_chainloader_real_boot (int drive, void *part_addr)
|
||||
*
|
||||
|
@ -683,7 +683,7 @@ FUNCTION(grub_biosdisk_rw_int13_extensions)
|
|||
movb %al, %dh
|
||||
/* enter real mode */
|
||||
call prot_to_real
|
||||
|
||||
|
||||
.code16
|
||||
movb %dh, %ah
|
||||
movw %cx, %ds
|
||||
|
@ -699,7 +699,7 @@ FUNCTION(grub_biosdisk_rw_int13_extensions)
|
|||
popl %ebp
|
||||
|
||||
ret
|
||||
|
||||
|
||||
/*
|
||||
* int grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff,
|
||||
* int soff, int nsec, int segment)
|
||||
|
@ -735,7 +735,7 @@ FUNCTION(grub_biosdisk_rw_standard)
|
|||
movw %ax, %di
|
||||
/* save SEGMENT in %bx */
|
||||
movw 0x14(%ebp), %bx
|
||||
|
||||
|
||||
/* enter real mode */
|
||||
call prot_to_real
|
||||
|
||||
|
@ -744,7 +744,7 @@ FUNCTION(grub_biosdisk_rw_standard)
|
|||
xorw %bx, %bx
|
||||
movw $3, %si /* attempt at least three times */
|
||||
|
||||
1:
|
||||
1:
|
||||
movw %di, %ax
|
||||
int $0x13 /* do the operation */
|
||||
jnc 2f /* check if successful */
|
||||
|
@ -753,19 +753,19 @@ FUNCTION(grub_biosdisk_rw_standard)
|
|||
/* if fail, reset the disk system */
|
||||
xorw %ax, %ax
|
||||
int $0x13
|
||||
|
||||
|
||||
decw %si
|
||||
cmpw $0, %si
|
||||
je 2f
|
||||
xorb %bl, %bl
|
||||
jmp 1b /* retry */
|
||||
2:
|
||||
2:
|
||||
/* back to protected mode */
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
movb %bl, %al /* return value in %eax */
|
||||
|
||||
|
||||
popl %esi
|
||||
popl %edi
|
||||
popl %ebx
|
||||
|
@ -794,7 +794,7 @@ FUNCTION(grub_biosdisk_check_int13_extensions)
|
|||
movb $0x41, %ah
|
||||
movw $0x55aa, %bx
|
||||
int $0x13 /* do the operation */
|
||||
|
||||
|
||||
/* check the result */
|
||||
jc 1f
|
||||
cmpw $0xaa55, %bx
|
||||
|
@ -805,7 +805,7 @@ FUNCTION(grub_biosdisk_check_int13_extensions)
|
|||
/* check if AH=0x42 is supported */
|
||||
andw $1, %cx
|
||||
jnz 2f
|
||||
|
||||
|
||||
1:
|
||||
xorb %bl, %bl
|
||||
2:
|
||||
|
@ -870,13 +870,13 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions)
|
|||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
|
||||
|
||||
ret
|
||||
|
||||
|
||||
/*
|
||||
* int grub_biosdisk_get_diskinfo_standard (int drive,
|
||||
* unsigned long *cylinders,
|
||||
* unsigned long *cylinders,
|
||||
* unsigned long *heads,
|
||||
* unsigned long *sectors)
|
||||
*
|
||||
|
@ -894,7 +894,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_standard)
|
|||
/* push HEADS */
|
||||
pushl %ecx
|
||||
/* SECTORS is on the stack */
|
||||
|
||||
|
||||
/* drive */
|
||||
movb %al, %dl
|
||||
/* enter real mode */
|
||||
|
@ -936,7 +936,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_standard)
|
|||
andb $0x3f, %cl
|
||||
movzbl %cl, %eax
|
||||
movl %eax, (%edi)
|
||||
|
||||
|
||||
xorl %eax, %eax
|
||||
movb %bl, %al /* return value in %eax */
|
||||
|
||||
|
@ -955,20 +955,20 @@ FUNCTION(grub_biosdisk_get_num_floppies)
|
|||
|
||||
xorl %edx, %edx
|
||||
call prot_to_real
|
||||
|
||||
|
||||
.code16
|
||||
/* reset the disk system first */
|
||||
int $0x13
|
||||
1:
|
||||
stc
|
||||
|
||||
|
||||
/* call GET DISK TYPE */
|
||||
movb $0x15, %ah
|
||||
int $0x13
|
||||
|
||||
jc 2f
|
||||
|
||||
/* check if this drive exists */
|
||||
/* check if this drive exists */
|
||||
testb $0x3, %ah
|
||||
jz 2f
|
||||
|
||||
|
@ -982,8 +982,8 @@ FUNCTION(grub_biosdisk_get_num_floppies)
|
|||
movl %edx, %eax
|
||||
popl %ebp
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* grub_get_memsize(i) : return the memory size in KB. i == 0 for conventional
|
||||
|
@ -1080,7 +1080,7 @@ FUNCTION(grub_get_mmap_entry)
|
|||
|
||||
/* push ADDR */
|
||||
pushl %eax
|
||||
|
||||
|
||||
/* place address (+4) in ES:DI */
|
||||
addl $4, %eax
|
||||
movl %eax, %edi
|
||||
|
@ -1148,7 +1148,7 @@ xsmap:
|
|||
popl %ebp
|
||||
ret
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* void grub_console_real_putchar (int c)
|
||||
*
|
||||
|
@ -1167,7 +1167,7 @@ FUNCTION(grub_console_real_putchar)
|
|||
movl %eax, %edx
|
||||
pusha
|
||||
movb EXT_C(grub_console_cur_color), %bl
|
||||
|
||||
|
||||
call prot_to_real
|
||||
.code16
|
||||
movb %dl, %al
|
||||
|
@ -1186,7 +1186,7 @@ FUNCTION(grub_console_real_putchar)
|
|||
/* save the character and the attribute on the stack */
|
||||
pushw %ax
|
||||
pushw %bx
|
||||
|
||||
|
||||
/* get the current position */
|
||||
movb $0x3, %ah
|
||||
int $0x10
|
||||
|
@ -1194,22 +1194,22 @@ FUNCTION(grub_console_real_putchar)
|
|||
/* check the column with the width */
|
||||
cmpb $79, %dl
|
||||
jl 2f
|
||||
|
||||
/* print CR and LF, if next write will exceed the width */
|
||||
|
||||
/* print CR and LF, if next write will exceed the width */
|
||||
movw $0x0e0d, %ax
|
||||
int $0x10
|
||||
movb $0x0a, %al
|
||||
int $0x10
|
||||
|
||||
|
||||
/* get the current position */
|
||||
movb $0x3, %ah
|
||||
int $0x10
|
||||
|
||||
2:
|
||||
2:
|
||||
/* restore the character and the attribute */
|
||||
popw %bx
|
||||
popw %ax
|
||||
|
||||
|
||||
/* write the character with the attribute */
|
||||
movb $0x9, %ah
|
||||
movw $1, %cx
|
||||
|
@ -1225,13 +1225,13 @@ FUNCTION(grub_console_real_putchar)
|
|||
1: movw $1, %bx
|
||||
movb $0xe, %ah
|
||||
int $0x10
|
||||
|
||||
|
||||
3: DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* int grub_console_getkey (void)
|
||||
|
@ -1254,7 +1254,7 @@ translation_table:
|
|||
.word GRUB_CONSOLE_KEY_PPAGE, GRUB_TERM_PPAGE
|
||||
.word GRUB_CONSOLE_KEY_NPAGE, GRUB_TERM_NPAGE
|
||||
.word 0
|
||||
|
||||
|
||||
/*
|
||||
* translate_keycode translates the key code %dx to an ascii code.
|
||||
*/
|
||||
|
@ -1263,14 +1263,14 @@ translation_table:
|
|||
translate_keycode:
|
||||
pushw %bx
|
||||
pushw %si
|
||||
|
||||
|
||||
#ifdef APPLE_CC
|
||||
translation_table_abs = ABS (translation_table) - 0x10000
|
||||
movw $(translation_table_abs), %si
|
||||
#else
|
||||
movw $ABS(translation_table), %si
|
||||
#endif
|
||||
|
||||
|
||||
1: lodsw
|
||||
/* check if this is the end */
|
||||
testw %ax, %ax
|
||||
|
@ -1289,7 +1289,7 @@ translate_keycode:
|
|||
ret
|
||||
|
||||
.code32
|
||||
|
||||
|
||||
FUNCTION(grub_console_getkey)
|
||||
pushl %ebp
|
||||
|
||||
|
@ -1317,7 +1317,7 @@ FUNCTION(grub_console_getkey)
|
|||
|
||||
movw %ax, %dx /* real_to_prot uses %eax */
|
||||
call translate_keycode
|
||||
|
||||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
|
@ -1343,7 +1343,7 @@ FUNCTION(grub_console_getkey)
|
|||
FUNCTION(grub_console_checkkey)
|
||||
pushl %ebp
|
||||
xorl %edx, %edx
|
||||
|
||||
|
||||
call prot_to_real /* enter real mode */
|
||||
.code16
|
||||
|
||||
|
@ -1351,7 +1351,7 @@ FUNCTION(grub_console_checkkey)
|
|||
int $0x16
|
||||
|
||||
jz notpending
|
||||
|
||||
|
||||
movw %ax, %dx
|
||||
DATA32 jmp pending
|
||||
|
||||
|
@ -1367,7 +1367,7 @@ pending:
|
|||
popl %ebp
|
||||
ret
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* grub_uint16_t grub_console_getxy (void)
|
||||
* BIOS call "INT 10H Function 03h" to get cursor position
|
||||
|
@ -1433,7 +1433,7 @@ FUNCTION(grub_console_gotoxy)
|
|||
popl %ebp
|
||||
ret
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* void grub_console_cls (void)
|
||||
* BIOS call "INT 10H Function 09h" to write character and attribute
|
||||
|
@ -1474,7 +1474,7 @@ FUNCTION(grub_console_cls)
|
|||
popl %ebp
|
||||
ret
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* void grub_console_setcursor (int on)
|
||||
* BIOS call "INT 10H Function 01h" to set cursor type
|
||||
|
@ -1487,14 +1487,14 @@ console_cursor_state:
|
|||
.byte 1
|
||||
console_cursor_shape:
|
||||
.word 0
|
||||
|
||||
|
||||
FUNCTION(grub_console_setcursor)
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
|
||||
/* push ON */
|
||||
pushl %eax
|
||||
|
||||
|
||||
/* check if the standard cursor shape has already been saved */
|
||||
movw console_cursor_shape, %ax
|
||||
testw %ax, %ax
|
||||
|
@ -1518,12 +1518,12 @@ FUNCTION(grub_console_setcursor)
|
|||
testl %eax, %eax
|
||||
jz 2f
|
||||
movw console_cursor_shape, %cx
|
||||
2:
|
||||
2:
|
||||
call prot_to_real
|
||||
.code16
|
||||
|
||||
movb $0x1, %ah
|
||||
int $0x10
|
||||
int $0x10
|
||||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
@ -1531,7 +1531,7 @@ FUNCTION(grub_console_setcursor)
|
|||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
|
||||
|
||||
/*
|
||||
* grub_getrtsecs()
|
||||
* if a seconds value can be read, read it and return it (BCD),
|
||||
|
@ -1572,7 +1572,7 @@ gottime:
|
|||
popl %ebp
|
||||
ret
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* grub_get_rtc()
|
||||
* return the real time in ticks, of which there are about
|
||||
|
@ -1669,7 +1669,7 @@ FUNCTION(grub_vbe_bios_get_controller_info)
|
|||
xorw %ax, %ax
|
||||
shrl $4, %eax
|
||||
mov %eax, %edx /* prot_to_real destroys %eax. */
|
||||
|
||||
|
||||
call prot_to_real
|
||||
.code16
|
||||
|
||||
|
@ -1688,7 +1688,7 @@ FUNCTION(grub_vbe_bios_get_controller_info)
|
|||
|
||||
movl %edx, %eax
|
||||
andl $0x0FFFF, %eax /* Return value in %eax. */
|
||||
|
||||
|
||||
pop %edx
|
||||
popl %edi
|
||||
popl %ebp
|
||||
|
@ -1770,7 +1770,7 @@ FUNCTION(grub_vbe_bios_set_mode)
|
|||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
|
||||
movw %dx, %ax
|
||||
andl $0xFFFF, %eax /* Return value in %eax. */
|
||||
|
||||
|
@ -1841,7 +1841,7 @@ FUNCTION(grub_vbe_bios_set_memory_window)
|
|||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
|
||||
movw %dx, %ax
|
||||
andl $0xFFFF, %eax /* Return value in %eax. */
|
||||
|
||||
|
@ -1914,7 +1914,7 @@ FUNCTION(grub_vbe_bios_set_scanline_length)
|
|||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
|
||||
movw %dx, %ax
|
||||
andl $0xFFFF, %eax /* Return value in %eax. */
|
||||
|
||||
|
@ -1977,7 +1977,7 @@ FUNCTION(grub_vbe_bios_set_display_start)
|
|||
.code16
|
||||
|
||||
movw $0x4f07, %ax
|
||||
movw $0x0080, %bx /* BL = 80h, Set Display Start
|
||||
movw $0x0080, %bx /* BL = 80h, Set Display Start
|
||||
during Vertical Retrace. */
|
||||
int $0x10
|
||||
|
||||
|
@ -1985,7 +1985,7 @@ FUNCTION(grub_vbe_bios_set_display_start)
|
|||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
|
||||
movw %dx, %ax
|
||||
andl $0xFFFF, %eax /* Return value in %eax. */
|
||||
|
||||
|
@ -2075,7 +2075,7 @@ FUNCTION(grub_vbe_bios_set_palette_data)
|
|||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
|
||||
movw %dx, %ax
|
||||
andl $0xFFFF, %eax /* Return value in %eax. */
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Note: These functions defined in this file may be called from C.
|
||||
* Be careful of that you must not modify some registers. Quote
|
||||
* from gcc-2.95.2/gcc/config/i386/i386.h:
|
||||
|
||||
|
||||
1 for registers not available across function calls.
|
||||
These must include the FIXED_REGISTERS and also any
|
||||
registers that can be used without being saved.
|
||||
|
@ -84,7 +84,7 @@ gdt:
|
|||
|
||||
/* -- data segment --
|
||||
* base = 0x00000000, limit 0xFFFFF (4 KiB Granularity), present
|
||||
* type = 32 bit data read/write, DPL = 0
|
||||
* type = 32 bit data read/write, DPL = 0
|
||||
*/
|
||||
.word 0xFFFF, 0
|
||||
.byte 0, 0x92, 0xCF, 0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* kern/i386/tsc.c - x86 TSC time source implementation
|
||||
* Requires Pentium or better x86 CPU that supports the RDTSC instruction.
|
||||
* This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to
|
||||
* This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to
|
||||
* real time.
|
||||
*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue