Move assembly code to C by using intwrap. It increases core size

by 88 bytes but improves compatibility and maintainability.

	* grub-core/kern/i386/pc/startup.S (grub_console_putchar): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_putchar_real):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_getkey): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_getkey):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_getxy): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_getxy):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_gotoxy): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_gotoxy):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_cls): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_cls):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_setcursor): Moved to ..
	* grub-core/term/i386/pc/console.c (grub_console_setcursor):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_get_rtc): Moved to ..
	* grub-core/kern/i386/pc/init.c (grub_get_rtc): ... here.
	Translated to C.
	* grub-core/term/i386/pc/console.c (int10_9): New function.
	(grub_console_putchar): Likewise.
	* include/grub/i386/pc/console.h: Removed the not anymore shared
	functions.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-11-12 16:29:04 +01:00
parent 678f4b6713
commit 2b23074a0c
5 changed files with 266 additions and 375 deletions

View file

@ -47,6 +47,22 @@ static int num_regions;
void (*grub_pc_net_config) (char **device, char **path);
/*
* return the real time in ticks, of which there are about
* 18-20 per second
*/
grub_uint32_t
grub_get_rtc (void)
{
struct grub_bios_int_registers regs;
regs.eax = 0;
regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
grub_bios_interrupt (0x1a, &regs);
return (regs.ecx << 16) | (regs.edx & 0xffff);
}
void
grub_machine_get_bootlocation (char **device, char **path)
{