2N/A/*
2N/A * GRUB -- GRand Unified Bootloader
2N/A * Copyright (C) 2009 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/kernel.h>
2N/A#include <grub/env.h>
2N/A#include <grub/cpu/time.h>
2N/A#include <grub/cpu/mips.h>
2N/A
2N/A/* FIXME: use interrupt to count high. */
2N/Agrub_uint64_t
2N/Agrub_get_rtc (void)
2N/A{
2N/A static grub_uint32_t high = 0;
2N/A static grub_uint32_t last = 0;
2N/A grub_uint32_t low;
2N/A
2N/A asm volatile ("mfc0 %0, " GRUB_CPU_MIPS_COP0_TIMER_COUNT : "=r" (low));
2N/A if (low < last)
2N/A high++;
2N/A last = low;
2N/A
2N/A return (((grub_uint64_t) high) << 32) | low;
2N/A}
2N/A
2N/Avoid
2N/Agrub_machine_get_bootlocation (char **device __attribute__ ((unused)),
2N/A char **path __attribute__ ((unused)))
2N/A{
2N/A}