bios.h revision 199767f8919635c4928607450d9e0abb932109ce
/*-
* Copyright (c) 1997 Michael Smith
* Copyright (c) 1998 Jonathan Lemon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _MACHINE_PC_BIOS_H_
#define _MACHINE_PC_BIOS_H_
/*
* Signature structure for the BIOS32 Service Directory header
*/
struct bios32_SDheader
{
};
/*
* PnP BIOS presence structure
*/
struct PnPBIOS_table
{
} __packed;
/*
* PnP BIOS return codes
*/
#define PNP_SUCCESS 0x00
#define PNP_NOT_SET_STATICALLY 0x7f
#define PNP_UNKNOWN_FUNCTION 0x81
#define PNP_FUNCTION_NOT_SUPPORTED 0x82
#define PNP_INVALID_HANDLE 0x83
#define PNP_BAD_PARAMETER 0x84
#define PNP_SET_FAILED 0x85
#define PNP_EVENTS_NOT_PENDING 0x86
#define PNP_SYSTEM_NOT_DOCKED 0x87
#define PNP_NO_ISA_PNP_CARDS 0x88
#define PNP_UNABLE_TO_DETERMINE_DOCK_CAPABILITIES 0x89
#define PNP_CONFIG_CHANGE_FAILED_NO_BATTERY 0x8a
#define PNP_CONFIG_CHANGE_FAILED_RESOURCE_CONFLICT 0x8b
#define PNP_BUFFER_TOO_SMALL 0x8c
#define PNP_USE_ESCD_SUPPORT 0x8d
#define PNP_MESSAGE_NOT_SUPPORTED 0x8e
#define PNP_HARDWARE_ERROR 0x8f
/*
* DMI return codes
*/
#define DMI_SUCCESS 0x00
#define DMI_UNKNOWN_FUNCTION 0x81
#define DMI_FUNCTION_NOT_SUPPORTED 0x82
#define DMI_INVALID_HANDLE 0x83
#define DMI_BAD_PARAMETER 0x84
#define DMI_INVALID_SUBFUNCTION 0x85
#define DMI_NO_CHANGE 0x86
#define DMI_ADD_STRUCTURE_FAILED 0x87
#define DMI_READ_ONLY 0x8d
#define DMI_LOCK_NOT_SUPPORTED 0x90
#define DMI_CURRENTLY_LOCKED 0x91
#define DMI_INVALID_LOCK 0x92
/*
* format specifiers and defines for bios16()
* s = short (16 bits)
* i = int (32 bits)
* p = pointer (converted to seg:offset)
*/
/*
* PCI BIOS functions
*/
#define PCIBIOS_BIOS_PRESENT 0xb101
#define PCIBIOS_READ_CONFIG_BYTE 0xb108
#define PCIBIOS_READ_CONFIG_WORD 0xb109
#define PCIBIOS_READ_CONFIG_DWORD 0xb10a
#define PCIBIOS_WRITE_CONFIG_BYTE 0xb10b
#define PCIBIOS_WRITE_CONFIG_WORD 0xb10c
#define PCIBIOS_WRITE_CONFIG_DWORD 0xb10d
#define PCIBIOS_GET_IRQ_ROUTING 0xb10e
#define PCIBIOS_ROUTE_INTERRUPT 0xb10f
/*
* PCI interrupt routing table.
*
* $PIR in the BIOS segment contains a PIR_table
* int 1a:b106 returns PIR_table in buffer at es:(e)di
* int 1a:b18e returns PIR_table in buffer at es:(e)di
* int 1a:b406 returns es:di pointing to the BIOS PIR_table
*/
struct PIR_header
{
} __packed;
struct PIR_intpin
{
} __packed;
struct PIR_entry
{
} __packed;
struct PIR_table
{
struct PIR_header pt_header;
} __packed;
/*
* Int 15:E820 'SMAP' structure
*/
#define SMAP_TYPE_MEMORY 1
#define SMAP_TYPE_RESERVED 2
#define SMAP_TYPE_ACPI_RECLAIM 3
#define SMAP_TYPE_ACPI_NVS 4
#define SMAP_TYPE_ACPI_ERROR 5
#define SMAP_XATTR_ENABLED 0x00000001
#define SMAP_XATTR_NON_VOLATILE 0x00000002
struct bios_smap {
} __packed;
/* Structure extended to include extended attribute field in ACPI 3.0. */
struct bios_smap_xattr {
} __packed;
/*
* System Management BIOS
*/
#define SMBIOS_START 0xf0000
#define SMBIOS_STEP 0x10
#define SMBIOS_OFF 0
#define SMBIOS_LEN 4
#define SMBIOS_SIG "_SM_"
struct smbios_eps {
};
struct smbios_structure_header {
};
#ifdef _KERNEL
#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE)
#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE)
struct bios_oem_signature {
char * anchor; /* search anchor string in BIOS memory */
} __packed;
struct bios_oem_range {
} __packed;
struct bios_oem {
struct bios_oem_range range;
struct bios_oem_signature signature[];
} __packed;
struct segment_info {
};
#define BIOSCODE_FLAG 0x01
#define BIOSDATA_FLAG 0x02
#define BIOSUTIL_FLAG 0x04
#define BIOSARGS_FLAG 0x08
struct bios_segments {
};
struct bios_regs {
};
struct bios_args {
struct bios_regs r;
struct bios_segments seg;
};
/*
* BIOS32 Service Directory entry. Caller supplies name, bios32_SDlookup
* fills in the rest of the details.
*/
struct bios32_SDentry
{
union
{
} ident;
};
/*
* Exported lookup results
*/
extern struct bios32_SDentry PCIbios;
int sigofs);
int bios16_call(struct bios_regs *, char *);
void set_bios_selectors(struct bios_segments *, int);
#endif
#endif /* _MACHINE_PC_BIOS_H_ */