Merge mainline into for_macros

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-09 22:35:32 +02:00
commit 4a55d631d7
113 changed files with 21429 additions and 3110 deletions

View file

@ -98,7 +98,10 @@ grub_device_iterate (int (*hook) (const char *name))
dev = grub_device_open (disk_name);
if (! dev)
return 0;
{
grub_errno = GRUB_ERR_NONE;
return 0;
}
if (dev->disk && dev->disk->has_partitions)
{

View file

@ -53,7 +53,7 @@
#include <multiboot.h>
#include <multiboot2.h>
#define ABS(x) ((x) - _start + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)
#define ABS(x) ((x) - LOCAL (base) + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)
.file "startup.S"
@ -66,16 +66,15 @@
.globl start, _start
start:
_start:
LOCAL (base):
/*
* Guarantee that "main" is loaded at 0x0:0x8200.
*/
#ifdef APPLE_CC
codestart_abs = ABS(codestart) - 0x10000
ljmp $0, $(codestart_abs)
#ifdef __APPLE__
ljmp $0, $(ABS(LOCAL (codestart)) - 0x10000)
#else
ljmp $0, $ABS(codestart)
ljmp $0, $ABS(LOCAL (codestart))
#endif
/*
* Compatibility version number
*
@ -183,7 +182,7 @@ multiboot_trampoline:
.code16
/* the real mode code continues... */
codestart:
LOCAL (codestart):
cli /* we're not safe here! */
/* set up %ds, %ss, and %es */
@ -1156,7 +1155,7 @@ FUNCTION(grub_console_real_putchar)
*/
/* this table is used in translate_keycode below */
translation_table:
LOCAL (translation_table):
.word GRUB_CONSOLE_KEY_LEFT, GRUB_TERM_LEFT
.word GRUB_CONSOLE_KEY_RIGHT, GRUB_TERM_RIGHT
.word GRUB_CONSOLE_KEY_UP, GRUB_TERM_UP
@ -1178,11 +1177,10 @@ translate_keycode:
pushw %bx
pushw %si
#ifdef APPLE_CC
translation_table_abs = ABS (translation_table) - 0x10000
movw $(translation_table_abs), %si
#ifdef __APPLE__
movw $(ABS(LOCAL (translation_table)) - 0x10000), %si
#else
movw $ABS(translation_table), %si
movw $ABS(LOCAL (translation_table)), %si
#endif
1: lodsw
@ -1446,47 +1444,6 @@ FUNCTION(grub_console_setcursor)
popl %ebp
ret
/*
* grub_getrtsecs()
* if a seconds value can be read, read it and return it (BCD),
* otherwise return 0xFF
* BIOS call "INT 1AH Function 02H" to check whether a character is pending
* Call with %ah = 0x2
* Return:
* If RT Clock can give correct values
* %ch = hour (BCD)
* %cl = minutes (BCD)
* %dh = seconds (BCD)
* %dl = daylight savings time (00h std, 01h daylight)
* Carry flag = clear
* else
* Carry flag = set
* (this indicates that the clock is updating, or
* that it isn't running)
*/
FUNCTION(grub_getrtsecs)
pushl %ebp
call prot_to_real /* enter real mode */
.code16
clc
movb $0x2, %ah
int $0x1a
DATA32 jnc gottime
movb $0xff, %dh
gottime:
DATA32 call real_to_prot
.code32
movb %dh, %al
popl %ebp
ret
/*
* grub_get_rtc()
* return the real time in ticks, of which there are about
@ -1541,33 +1498,6 @@ FUNCTION(grub_vga_set_mode)
popl %ebp
ret
/*
* unsigned char *grub_vga_get_font (void)
*/
FUNCTION(grub_vga_get_font)
pushl %ebp
pushl %ebx
call prot_to_real
.code16
movw $0x1130, %ax
movb $0x06, %bh
int $0x10
movw %es, %bx
movw %bp, %dx
DATA32 call real_to_prot
.code32
movzwl %bx, %ecx
shll $4, %ecx
movw %dx, %ax
addl %ecx, %eax
popl %ebx
popl %ebp
ret
/*
* grub_vbe_bios_status_t grub_vbe_get_controller_info (struct grub_vbe_info_block *controller_info)
*

View file

@ -73,10 +73,16 @@ grub_children_iterate (char *devpath,
IEEE1275_MAX_PROP_LEN, &actual))
childtype[0] = 0;
if (dev == child)
continue;
if (grub_ieee1275_package_to_path (child, childpath,
IEEE1275_MAX_PATH_LEN, &actual))
continue;
if (grub_strcmp (devpath, childpath) == 0)
continue;
if (grub_ieee1275_get_property (child, "name", childname,
IEEE1275_MAX_PROP_LEN, &actual))
continue;

View file

@ -1058,7 +1058,7 @@ grub_abort (void)
void abort (void) __attribute__ ((alias ("grub_abort")));
#endif
#ifdef NEED_ENABLE_EXECUTE_STACK
#if defined(NEED_ENABLE_EXECUTE_STACK) && !defined(GRUB_UTIL)
/* Some gcc versions generate a call to this function
in trampolines for nested functions. */
void __enable_execute_stack (void *addr __attribute__ ((unused)))