2N/A/* init.c - initialize an ia64-based EFI system */
2N/A/*
2N/A * GRUB -- GRand Unified Bootloader
2N/A * Copyright (C) 2008 Free Software Foundation, Inc.
2N/A *
2N/A * GRUB is free software: you can redistribute it and/or modify
2N/A * it under the terms of the GNU General Public License as published by
2N/A * the Free Software Foundation, either version 3 of the License, or
2N/A * (at your option) any later version.
2N/A *
2N/A * GRUB is distributed in the hope that it will be useful,
2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A * GNU General Public License for more details.
2N/A *
2N/A * You should have received a copy of the GNU General Public License
2N/A * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
2N/A */
2N/A
2N/A#include <grub/types.h>
2N/A#include <grub/misc.h>
2N/A#include <grub/mm.h>
2N/A#include <grub/time.h>
2N/A#include <grub/err.h>
2N/A#include <grub/dl.h>
2N/A#include <grub/cache.h>
2N/A#include <grub/kernel.h>
2N/A#include <grub/efi/efi.h>
2N/A
2N/Avoid
2N/Agrub_machine_init (void)
2N/A{
2N/A grub_efi_init ();
2N/A grub_install_get_time_ms (grub_rtc_get_time_ms);
2N/A}
2N/A
2N/Avoid
2N/Agrub_machine_fini (void)
2N/A{
2N/A grub_efi_fini ();
2N/A}
2N/A
2N/Avoid
2N/Agrub_arch_sync_caches (void *address, grub_size_t len)
2N/A{
2N/A /* Cache line length is at least 32. */
2N/A grub_uint64_t a = (grub_uint64_t)address & ~0x1f;
2N/A
2N/A /* Flush data. */
2N/A for (len = (len + 31) & ~0x1f; len > 0; len -= 0x20, a += 0x20)
2N/A asm volatile ("fc.i %0" : : "r" (a));
2N/A /* Sync and serialize. Maybe extra. */
2N/A asm volatile (";; sync.i;; srlz.i;;");
2N/A}