mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-28 00:11:15 +00:00
experimental support for loongson mips64el uefi
This commit is contained in:
10
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/asm.h
Normal file
10
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/asm.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef GRUB_MIPS64_ASM_HEADER
|
||||
#define GRUB_MIPS64_ASM_HEADER 1
|
||||
|
||||
#define GRUB_ASM_T4 $a4
|
||||
#define GRUB_ASM_T5 $a5
|
||||
#define GRUB_ASM_SZREG 8
|
||||
#define GRUB_ASM_REG_S sd
|
||||
#define GRUB_ASM_REG_L ld
|
||||
|
||||
#endif
|
25
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loader.h
Normal file
25
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loader.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2003,2004,2006,2007,2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_LOADER_MACHINE_HEADER
|
||||
#define GRUB_LOADER_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#endif /* ! GRUB_LOADER_MACHINE_HEADER */
|
303
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loongson.h
Normal file
303
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loongson.h
Normal file
@@ -0,0 +1,303 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_EFI_LOONGSON_HEADER
|
||||
#define GRUB_EFI_LOONGSON_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
#include <grub/efi/api.h>
|
||||
|
||||
#define GRUB_EFI_LOONGSON_SMBIOS_TABLE_GUID \
|
||||
{ 0x4660f721, 0x2ec5, 0x416a, \
|
||||
{ 0x89, 0x9a, 0x43, 0x18, 0x02, 0x50, 0xa0, 0xc9 } \
|
||||
}
|
||||
|
||||
#define GRUB_EFI_LOONGSON_MMAP_MAX 128
|
||||
typedef enum
|
||||
{
|
||||
GRUB_EFI_LOONGSON_SYSTEM_RAM_LOW = 1,
|
||||
GRUB_EFI_LOONGSON_SYSTEM_RAM_HIGH,
|
||||
GRUB_EFI_LOONGSON_MEMORY_RESERVED,
|
||||
GRUB_EFI_LOONGSON_PCI_IO,
|
||||
GRUB_EFI_LOONGSON_PCI_MEM,
|
||||
GRUB_EFI_LOONGSON_CFG_REG,
|
||||
GRUB_EFI_LOONGSON_VIDEO_ROM,
|
||||
GRUB_EFI_LOONGSON_ADAPTER_ROM,
|
||||
GRUB_EFI_LOONGSON_ACPI_TABLE,
|
||||
GRUB_EFI_LOONGSON_SMBIOS_TABLE,
|
||||
GRUB_EFI_LOONGSON_UMA_VIDEO_RAM,
|
||||
GRUB_EFI_LOONGSON_VUMA_VIDEO_RAM,
|
||||
GRUB_EFI_LOONGSON_SYSTEM_RAM_LOW_DMA,
|
||||
GRUB_EFI_LOONGSON_SYSTEM_RAM_HIGH_DMA,
|
||||
GRUB_EFI_LOONGSON_ACPI_NVS,
|
||||
GRUB_EFI_LOONGSON_MAX_MEMORY_TYPE
|
||||
}
|
||||
grub_efi_loongson_memory_type;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint16_t vers; /* version */
|
||||
grub_uint32_t nr_map; /* number of memory_maps */
|
||||
grub_uint32_t mem_freq; /* memory frequence */
|
||||
struct mem_map {
|
||||
grub_uint32_t node_id; /* node_id which memory attached to */
|
||||
grub_uint32_t mem_type; /* system memory, pci memory, pci io, etc. */
|
||||
grub_uint64_t mem_start; /* memory map start address */
|
||||
grub_uint32_t mem_size; /* each memory_map size, not the total size */
|
||||
} map[GRUB_EFI_LOONGSON_MMAP_MAX];
|
||||
} GRUB_PACKED
|
||||
grub_efi_loongson_memory_map;
|
||||
|
||||
/*
|
||||
* Capability and feature descriptor structure for MIPS CPU
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
grub_uint16_t vers; /* version */
|
||||
grub_uint32_t processor_id; /* PRID, e.g. 6305, 6306 */
|
||||
grub_uint32_t cputype; /* Loongson_3A/3B, etc. */
|
||||
grub_uint32_t total_node; /* num of total numa nodes */
|
||||
grub_uint16_t cpu_startup_core_id; /* Boot core id */
|
||||
grub_uint16_t reserved_cores_mask;
|
||||
grub_uint32_t cpu_clock_freq; /* cpu_clock */
|
||||
grub_uint32_t nr_cpus;
|
||||
} GRUB_PACKED
|
||||
grub_efi_loongson_cpu_info;
|
||||
|
||||
#define GRUB_EFI_LOONGSON_MAX_UARTS 64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint32_t iotype; /* see include/linux/serial_core.h */
|
||||
grub_uint32_t uartclk;
|
||||
grub_uint32_t int_offset;
|
||||
grub_uint64_t uart_base;
|
||||
} GRUB_PACKED
|
||||
grub_efi_loongson_uart_device;
|
||||
|
||||
#define GRUB_EFI_LOONGSON_MAX_SENSORS 64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[32]; /* a formal name */
|
||||
char label[64]; /* a flexible description */
|
||||
grub_uint32_t type; /* SENSOR_* */
|
||||
grub_uint32_t id; /* instance id of a sensor-class */
|
||||
grub_uint32_t fan_policy;
|
||||
grub_uint32_t fan_percent; /* only for constant speed policy */
|
||||
grub_uint64_t base_addr; /* base address of device registers */
|
||||
} GRUB_PACKED
|
||||
grub_efi_loongson_sensor_device;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint16_t vers; /* version */
|
||||
grub_uint32_t ccnuma_smp; /* 0: no numa; 1: has numa */
|
||||
grub_uint32_t sing_double_channel; /* 1:single; 2:double */
|
||||
grub_uint32_t nr_uarts;
|
||||
grub_efi_loongson_uart_device uarts[GRUB_EFI_LOONGSON_MAX_UARTS];
|
||||
grub_uint32_t nr_sensors;
|
||||
grub_efi_loongson_sensor_device sensors[GRUB_EFI_LOONGSON_MAX_SENSORS];
|
||||
char has_ec;
|
||||
char ec_name[32];
|
||||
grub_uint64_t ec_base_addr;
|
||||
char has_tcm;
|
||||
char tcm_name[32];
|
||||
grub_uint64_t tcm_base_addr;
|
||||
grub_uint64_t workarounds; /* see workarounds.h */
|
||||
} GRUB_PACKED
|
||||
grub_efi_loongson_system_info;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint16_t vers;
|
||||
grub_uint16_t size;
|
||||
grub_uint16_t rtr_bus;
|
||||
grub_uint16_t rtr_devfn;
|
||||
grub_uint32_t vendor;
|
||||
grub_uint32_t device;
|
||||
grub_uint32_t PIC_type; /* conform use HT or PCI to route to CPU-PIC */
|
||||
grub_uint64_t ht_int_bit; /* 3A: 1<<24; 3B: 1<<16 */
|
||||
grub_uint64_t ht_enable; /* irqs used in this PIC */
|
||||
grub_uint32_t node_id; /* node id: 0x0-0; 0x1-1; 0x10-2; 0x11-3 */
|
||||
grub_uint64_t pci_mem_start_addr;
|
||||
grub_uint64_t pci_mem_end_addr;
|
||||
grub_uint64_t pci_io_start_addr;
|
||||
grub_uint64_t pci_io_end_addr;
|
||||
grub_uint64_t pci_config_addr;
|
||||
grub_uint32_t dma_mask_bits;
|
||||
} GRUB_PACKED
|
||||
grub_efi_loongson_irq_src_routing_table;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint16_t vers; /* version */
|
||||
grub_uint16_t size;
|
||||
grub_uint8_t flag;
|
||||
char description[64];
|
||||
} GRUB_PACKED
|
||||
grub_efi_loongson_interface_info;
|
||||
|
||||
#define GRUB_EFI_LOONGSON_MAX_RESOURCE_NUMBER 128
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint64_t start; /* resource start address */
|
||||
grub_uint64_t end; /* resource end address */
|
||||
char name[64];
|
||||
grub_uint32_t flags;
|
||||
}
|
||||
grub_efi_loongson_resource;
|
||||
|
||||
/* arch specific additions */
|
||||
typedef struct
|
||||
{
|
||||
}
|
||||
grub_efi_loongson_archdev_data;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[64]; /* hold the device name */
|
||||
grub_uint32_t num_resources; /* number of device_resource */
|
||||
/* for each device's resource */
|
||||
grub_efi_loongson_resource resource[GRUB_EFI_LOONGSON_MAX_RESOURCE_NUMBER];
|
||||
/* arch specific additions */
|
||||
grub_efi_loongson_archdev_data archdata;
|
||||
}
|
||||
grub_efi_loongson_board_devices;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint16_t vers; /* version */
|
||||
char special_name[64]; /* special_atribute_name */
|
||||
grub_uint32_t loongson_special_type; /* type of special device */
|
||||
/* for each device's resource */
|
||||
grub_efi_loongson_resource resource[GRUB_EFI_LOONGSON_MAX_RESOURCE_NUMBER];
|
||||
}
|
||||
grub_efi_loongson_special_attribute;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint64_t memory_offset; /* efi_loongson_memory_map struct offset */
|
||||
grub_uint64_t cpu_offset; /* efi_loongson_cpuinfo struct offset */
|
||||
grub_uint64_t system_offset; /* efi_loongson_system_info struct offset */
|
||||
grub_uint64_t irq_offset; /* efi_loongson_irq_src_routing_table struct offset */
|
||||
grub_uint64_t interface_offset; /* interface_info struct offset */
|
||||
grub_uint64_t special_offset; /* efi_loongson_special_attribute struct offset */
|
||||
grub_uint64_t boarddev_table_offset; /* efi_loongson_board_devices offset */
|
||||
}
|
||||
grub_efi_loongson_params;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint16_t vers; /* version */
|
||||
grub_uint64_t vga_bios; /* vga_bios address */
|
||||
grub_efi_loongson_params lp;
|
||||
}
|
||||
grub_efi_loongson_smbios_table;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint64_t reset_cold;
|
||||
grub_uint64_t reset_warm;
|
||||
grub_uint64_t reset_type;
|
||||
grub_uint64_t shutdown;
|
||||
grub_uint64_t do_suspend; /* NULL if not support */
|
||||
}
|
||||
grub_efi_loongson_reset_system;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_uint64_t mps; /* MPS table */
|
||||
grub_uint64_t acpi; /* ACPI table (IA64 ext 0.71) */
|
||||
grub_uint64_t acpi20; /* ACPI table (ACPI 2.0) */
|
||||
grub_efi_loongson_smbios_table smbios; /* SM BIOS table */
|
||||
grub_uint64_t sal_systab; /* SAL system table */
|
||||
grub_uint64_t boot_info; /* boot info table */
|
||||
}
|
||||
grub_efi_loongson;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
grub_efi_loongson efi;
|
||||
grub_efi_loongson_reset_system reset_system;
|
||||
}
|
||||
grub_efi_loongson_boot_params;
|
||||
|
||||
extern grub_uint64_t grub_efi_loongson_reset_system_addr;
|
||||
|
||||
extern void grub_efi_loongson_reset_cold (void);
|
||||
extern void grub_efi_loongson_reset_warm (void);
|
||||
extern void grub_efi_loongson_reset_shutdown (void);
|
||||
extern void grub_efi_loongson_reset_suspend (void);
|
||||
|
||||
void grub_efi_loongson_init (void);
|
||||
void grub_efi_loongson_fini (void);
|
||||
void grub_efi_loongson_alloc_boot_params (void);
|
||||
void grub_efi_loongson_free_boot_params (void);
|
||||
void * grub_efi_loongson_get_smbios_table (void);
|
||||
|
||||
int EXPORT_FUNC(grub_efi_is_loongson) (void);
|
||||
|
||||
grub_uint8_t
|
||||
EXPORT_FUNC(grub_efi_loongson_calculatesum8) (const grub_uint8_t *Buffer, grub_efi_uintn_t Length);
|
||||
|
||||
grub_uint8_t
|
||||
EXPORT_FUNC(grub_efi_loongson_grub_calculatechecksum8) (const grub_uint8_t *Buffer, grub_efi_uintn_t Length);
|
||||
|
||||
|
||||
void *
|
||||
EXPORT_FUNC(grub_efi_loongson_get_boot_params) (void);
|
||||
|
||||
typedef struct _extention_list_hdr{
|
||||
grub_uint64_t signature;
|
||||
grub_uint32_t length;
|
||||
grub_uint8_t revision;
|
||||
grub_uint8_t checksum;
|
||||
struct _extention_list_hdr *next;
|
||||
}GRUB_PACKED
|
||||
ext_list;
|
||||
|
||||
typedef struct bootparamsinterface {
|
||||
grub_uint64_t signature; //{'B', 'P', 'I', '_', '0', '_', '1'}
|
||||
grub_efi_system_table_t *systemtable;
|
||||
ext_list *extlist;
|
||||
}GRUB_PACKED
|
||||
bootparamsinterface;
|
||||
|
||||
typedef struct {
|
||||
ext_list header; // {'M', 'E', 'M'}
|
||||
grub_uint8_t mapcount;
|
||||
struct GRUB_PACKED memmap {
|
||||
grub_uint32_t memtype;
|
||||
grub_uint64_t memstart;
|
||||
grub_uint64_t memsize;
|
||||
} map[GRUB_EFI_LOONGSON_MMAP_MAX];
|
||||
}GRUB_PACKED
|
||||
mem_map;
|
||||
|
||||
typedef struct {
|
||||
ext_list header; // {VBIOS}
|
||||
grub_uint64_t vbiosaddr;
|
||||
}GRUB_PACKED
|
||||
vbios;
|
||||
|
||||
grub_uint32_t
|
||||
EXPORT_FUNC (grub_efi_loongson_memmap_sort) (struct memmap array[], grub_uint32_t length, mem_map * bpmem, grub_uint32_t index, grub_uint32_t memtype);
|
||||
#endif /* ! GRUB_EFI_LOONGSON_HEADER */
|
7
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/memory.h
Normal file
7
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/memory.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef GRUB_MEMORY_CPU_HEADER
|
||||
#include <grub/efi/memory.h>
|
||||
|
||||
//#define GRUB_EFI_MAX_USABLE_ADDRESS 0x980000000fffffffUL
|
||||
#define GRUB_EFI_MAX_USABLE_ADDRESS 0x98000000ffffffffUL
|
||||
|
||||
#endif /* ! GRUB_MEMORY_CPU_HEADER */
|
62
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/io.h
Normal file
62
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/io.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009,2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_IO_H
|
||||
#define GRUB_IO_H 1
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
typedef grub_addr_t grub_port_t;
|
||||
|
||||
static __inline unsigned char
|
||||
grub_inb (grub_port_t port)
|
||||
{
|
||||
return *(volatile grub_uint8_t *) port;
|
||||
}
|
||||
|
||||
static __inline unsigned short int
|
||||
grub_inw (grub_port_t port)
|
||||
{
|
||||
return *(volatile grub_uint16_t *) port;
|
||||
}
|
||||
|
||||
static __inline unsigned int
|
||||
grub_inl (grub_port_t port)
|
||||
{
|
||||
return *(volatile grub_uint32_t *) port;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
grub_outb (unsigned char value, grub_port_t port)
|
||||
{
|
||||
*(volatile grub_uint8_t *) port = value;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
grub_outw (unsigned short int value, grub_port_t port)
|
||||
{
|
||||
*(volatile grub_uint16_t *) port = value;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
grub_outl (unsigned int value, grub_port_t port)
|
||||
{
|
||||
*(volatile grub_uint32_t *) port = value;
|
||||
}
|
||||
|
||||
#endif /* _SYS_IO_H */
|
24
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/kernel.h
Normal file
24
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/kernel.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2006,2007,2008,2009,2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_KERNEL_CPU_HEADER
|
||||
#define GRUB_KERNEL_CPU_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
57
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/memory.h
Normal file
57
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/memory.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_MEMORY_CPU_HEADER
|
||||
#define GRUB_MEMORY_CPU_HEADER 1
|
||||
|
||||
#ifndef ASM_FILE
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#endif
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef grub_addr_t grub_phys_addr_t;
|
||||
|
||||
static inline grub_phys_addr_t
|
||||
grub_vtop (void *a)
|
||||
{
|
||||
if (-1 == ((grub_int64_t) a >> 32))
|
||||
return ((grub_phys_addr_t) a) & 0x1fffffffUL;
|
||||
return ((grub_phys_addr_t) a) & 0xffffffffffffUL;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
grub_map_memory (grub_phys_addr_t a, grub_size_t size)
|
||||
{
|
||||
if ((a + size) < 0x20000000UL)
|
||||
return (void *) (a | 0xffffffff80000000UL);
|
||||
// return (void *) (a | 0x9800000000000000UL);
|
||||
return (void *) ((a&0x8fffffff) | 0xffffffff00000000UL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_unmap_memory (void *a __attribute__ ((unused)),
|
||||
grub_size_t size __attribute__ ((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
30
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/mips.h
Normal file
30
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/mips.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2010,2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_REGISTERS_CPU_HEADER
|
||||
#define GRUB_REGISTERS_CPU_HEADER 1
|
||||
|
||||
#ifdef ASM_FILE
|
||||
#define GRUB_CPU_REGISTER_WRAP(x) x
|
||||
#else
|
||||
#define GRUB_CPU_REGISTER_WRAP(x) #x
|
||||
#endif
|
||||
|
||||
#define GRUB_CPU_MIPS_COP0_TIMER_COUNT GRUB_CPU_REGISTER_WRAP($9)
|
||||
|
||||
#endif
|
38
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/relocator.h
Normal file
38
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/relocator.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_RELOCATOR_CPU_HEADER
|
||||
#define GRUB_RELOCATOR_CPU_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/relocator.h>
|
||||
|
||||
struct grub_relocator64_state
|
||||
{
|
||||
/* gpr[0] is ignored since it's hardwired to 0. */
|
||||
grub_uint64_t gpr[32];
|
||||
/* Register holding target $pc. */
|
||||
int jumpreg;
|
||||
};
|
||||
|
||||
grub_err_t
|
||||
grub_relocator64_boot (struct grub_relocator *rel,
|
||||
struct grub_relocator64_state state);
|
||||
|
||||
#endif /* ! GRUB_RELOCATOR_CPU_HEADER */
|
27
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/setjmp.h
Normal file
27
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/setjmp.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2004,2006,2007,2009,2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_SETJMP_CPU_HEADER
|
||||
#define GRUB_SETJMP_CPU_HEADER 1
|
||||
|
||||
typedef grub_uint64_t grub_jmp_buf[12];
|
||||
|
||||
int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE;
|
||||
void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn));
|
||||
|
||||
#endif /* ! GRUB_SETJMP_CPU_HEADER */
|
39
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/time.h
Normal file
39
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/time.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003,2004,2005,2007,2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KERNEL_CPU_TIME_HEADER
|
||||
#define KERNEL_CPU_TIME_HEADER 1
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
|
||||
#define GRUB_TICKS_PER_SECOND (grub_arch_cpuclock / 2)
|
||||
|
||||
void grub_timer_init (grub_uint32_t cpuclock);
|
||||
|
||||
/* Return the real time in ticks. */
|
||||
grub_uint64_t grub_get_rtc (void);
|
||||
|
||||
extern grub_uint32_t grub_arch_cpuclock;
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
grub_cpu_idle(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
38
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/types.h
Normal file
38
GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/types.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2006,2007,2009,2017 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_TYPES_CPU_HEADER
|
||||
#define GRUB_TYPES_CPU_HEADER 1
|
||||
|
||||
/* The size of void *. */
|
||||
#define GRUB_TARGET_SIZEOF_VOID_P 8
|
||||
|
||||
/* The size of long. */
|
||||
#define GRUB_TARGET_SIZEOF_LONG 8
|
||||
|
||||
#ifdef GRUB_CPU_MIPS64EL
|
||||
/* mips64EL is little-endian. */
|
||||
#undef GRUB_TARGET_WORDS_BIGENDIAN
|
||||
#elif defined (GRUB_CPU_MIPS64)
|
||||
/* mips64 is big-endian. */
|
||||
#define GRUB_TARGET_WORDS_BIGENDIAN
|
||||
#elif !defined (GRUB_SYMBOL_GENERATOR)
|
||||
#error Neither GRUB_CPU_MIPS64 nor GRUB_CPU_MIPS64EL is defined
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_TYPES_CPU_HEADER */
|
Reference in New Issue
Block a user