commit
91391dc52b
86 changed files with 1935 additions and 1034 deletions
|
@ -67,7 +67,7 @@ grub_machine_fini (int flags)
|
|||
|
||||
b = grub_efi_system_table->boot_services;
|
||||
|
||||
efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0);
|
||||
efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0);
|
||||
efi_call_1 (b->close_event, tmr_evt);
|
||||
|
||||
grub_efi_fini ();
|
||||
|
|
|
@ -381,9 +381,24 @@ __aeabi_idiv (grub_int32_t a, grub_int32_t b)
|
|||
__attribute__ ((alias ("__divsi3")));
|
||||
void *__aeabi_memcpy (void *dest, const void *src, grub_size_t n)
|
||||
__attribute__ ((alias ("grub_memcpy")));
|
||||
void *__aeabi_memcpy4 (void *dest, const void *src, grub_size_t n)
|
||||
__attribute__ ((alias ("grub_memcpy")));
|
||||
void *__aeabi_memcpy8 (void *dest, const void *src, grub_size_t n)
|
||||
__attribute__ ((alias ("grub_memcpy")));
|
||||
void *__aeabi_memset (void *s, int c, grub_size_t n)
|
||||
__attribute__ ((alias ("memset")));
|
||||
|
||||
void
|
||||
__aeabi_memclr (void *s, grub_size_t n)
|
||||
{
|
||||
grub_memset (s, 0, n);
|
||||
}
|
||||
|
||||
void __aeabi_memclr4 (void *s, grub_size_t n)
|
||||
__attribute__ ((alias ("__aeabi_memclr")));
|
||||
void __aeabi_memclr8 (void *s, grub_size_t n)
|
||||
__attribute__ ((alias ("__aeabi_memclr")));
|
||||
|
||||
int
|
||||
__aeabi_ulcmp (grub_uint64_t a, grub_uint64_t b)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <grub/term.h>
|
||||
#include <grub/kernel.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/loader.h>
|
||||
|
||||
/* The handle of GRUB itself. Filled in by the startup code. */
|
||||
grub_efi_handle_t grub_efi_image_handle;
|
||||
|
@ -156,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle)
|
|||
void
|
||||
grub_exit (void)
|
||||
{
|
||||
grub_efi_fini ();
|
||||
grub_machine_fini (GRUB_LOADER_FLAG_NORETURN);
|
||||
efi_call_4 (grub_efi_system_table->boot_services->exit,
|
||||
grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0);
|
||||
for (;;) ;
|
||||
|
@ -205,6 +206,7 @@ grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid,
|
|||
| GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS
|
||||
| GRUB_EFI_VARIABLE_RUNTIME_ACCESS),
|
||||
datasize, data);
|
||||
grub_free (var16);
|
||||
if (status == GRUB_EFI_SUCCESS)
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
|
@ -236,8 +238,11 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
|
|||
|
||||
status = efi_call_5 (r->get_variable, var16, guid, NULL, &datasize, NULL);
|
||||
|
||||
if (!datasize)
|
||||
return NULL;
|
||||
if (status != GRUB_EFI_BUFFER_TOO_SMALL || !datasize)
|
||||
{
|
||||
grub_free (var16);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data = grub_malloc (datasize);
|
||||
if (!data)
|
||||
|
@ -422,6 +427,47 @@ grub_efi_get_device_path (grub_efi_handle_t handle)
|
|||
GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
|
||||
}
|
||||
|
||||
/* Return the device path node right before the end node. */
|
||||
grub_efi_device_path_t *
|
||||
grub_efi_find_last_device_path (const grub_efi_device_path_t *dp)
|
||||
{
|
||||
grub_efi_device_path_t *next, *p;
|
||||
|
||||
if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp))
|
||||
return 0;
|
||||
|
||||
for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p);
|
||||
! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next);
|
||||
p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next))
|
||||
;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Duplicate a device path. */
|
||||
grub_efi_device_path_t *
|
||||
grub_efi_duplicate_device_path (const grub_efi_device_path_t *dp)
|
||||
{
|
||||
grub_efi_device_path_t *p;
|
||||
grub_size_t total_size = 0;
|
||||
|
||||
for (p = (grub_efi_device_path_t *) dp;
|
||||
;
|
||||
p = GRUB_EFI_NEXT_DEVICE_PATH (p))
|
||||
{
|
||||
total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p);
|
||||
if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p))
|
||||
break;
|
||||
}
|
||||
|
||||
p = grub_malloc (total_size);
|
||||
if (! p)
|
||||
return 0;
|
||||
|
||||
grub_memcpy (p, dp, total_size);
|
||||
return p;
|
||||
}
|
||||
|
||||
static void
|
||||
dump_vendor_path (const char *type, grub_efi_vendor_device_path_t *vendor)
|
||||
{
|
||||
|
|
|
@ -422,7 +422,7 @@ read_device_map (const char *dev_map)
|
|||
char buf[1024]; /* XXX */
|
||||
int lineno = 0;
|
||||
|
||||
if (dev_map[0] == '\0')
|
||||
if (!dev_map || dev_map[0] == '\0')
|
||||
{
|
||||
grub_util_info ("no device.map");
|
||||
return;
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/cpu/kernel.h>
|
||||
|
||||
.set noreorder
|
||||
.set nomacro
|
||||
mips_attributes
|
||||
|
||||
FUNCTION (grub_arch_sync_caches)
|
||||
#include "cache_flush.S"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <grub/offsets.h>
|
||||
#include <grub/machine/memory.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
#include <grub/cpu/kernel.h>
|
||||
#include <grub/offsets.h>
|
||||
|
||||
#define BASE_ADDR 8
|
||||
|
@ -29,7 +28,6 @@
|
|||
.globl __start, _start, start
|
||||
.set noreorder
|
||||
.set nomacro
|
||||
mips_attributes
|
||||
__start:
|
||||
_start:
|
||||
start:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue