summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include/biosvar.h
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-10-22 23:37:14 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-10-22 23:37:14 +0000
commit3e53b8008383416ea23a2792b87f2831dc401568 (patch)
tree557e1a20539f7d8a72028b3cea8f86ce23bc12c1 /sys/arch/i386/include/biosvar.h
parent75ff2b524f49004c6afee07d65b8dfa530bf747d (diff)
support new libsa
Diffstat (limited to 'sys/arch/i386/include/biosvar.h')
-rw-r--r--sys/arch/i386/include/biosvar.h126
1 files changed, 49 insertions, 77 deletions
diff --git a/sys/arch/i386/include/biosvar.h b/sys/arch/i386/include/biosvar.h
index d4ea9e94c01..b125b18c165 100644
--- a/sys/arch/i386/include/biosvar.h
+++ b/sys/arch/i386/include/biosvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosvar.h,v 1.20 1997/10/20 14:47:41 mickey Exp $ */
+/* $OpenBSD: biosvar.h,v 1.21 1997/10/22 23:37:13 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -35,12 +35,7 @@
#ifndef _I386_BIOSVAR_H_
#define _I386_BIOSVAR_H_
-#define BOOT_APIVER 0x00000001
-
-#define BIOSNHEADS(d) (((d)>>24)+1)
-#define BIOSNSECTS(d) ((d)&0x3f) /* sectors are 1-based */
-#define BIOSNDRIVES(d) ((((d)>>16)&0x0f)+1)
-#define BIOSNTRACKS(d) (( (((d)>>8)&0xff) | (((d)&0xc0)<<2) ) +1)
+#define BOOT_APIVER 0x00000002
/* BIOS media ID */
#define BIOSM_F320K 0xff /* floppy ds/sd 8 spt */
@@ -59,7 +54,7 @@
*/
#define BIOS_MAP_END 0x00 /* End of array XXX - special */
#define BIOS_MAP_FREE 0x01 /* Usable memory */
-#define BIOS_MAP_RES 0x02 /* Reseved memory */
+#define BIOS_MAP_RES 0x02 /* Reserved memory */
#define BIOS_MAP_ACPI 0x03 /* ACPI Reclaim memory */
#define BIOS_MAP_NVS 0x04 /* ACPI NVS memory */
@@ -67,7 +62,7 @@
* CTL_BIOS definitions.
*/
#define BIOS_DEV 1 /* int: BIOS boot device */
-#define BIOS_GEOMETRY 2 /* int: BIOS boot device geometry */
+#define BIOS_DISKINFO 2 /* struct: BIOS boot device info */
#define BIOS_CNVMEM 3 /* int: amount of conventional memory */
#define BIOS_EXTMEM 4 /* int: amount of extended memory */
#define BIOS_MAXID 5 /* number of valid machdep ids */
@@ -75,55 +70,12 @@
#define CTL_BIOS_NAMES { \
{ 0, 0 }, \
{ "biosdev", CTLTYPE_INT }, \
- { "biosgeo", CTLTYPE_INT }, \
+ { "diskinfo", CTLTYPE_STRUCT }, \
{ "cnvmem", CTLTYPE_INT }, \
{ "extmem", CTLTYPE_INT }, \
}
-#if defined(_KERNEL) || defined (_STANDALONE)
-
-#ifdef _LOCORE
-#define DOINT(n) int $0x20+(n)
-#else
-#define DOINT(n) "int $0x20+(" #n ")"
-
-extern struct BIOS_vars {
- /* XXX filled in assumption that last file opened is kernel */
- int bios_dev;
- u_int bios_geometry;
-
- /* APM_CONNECT returned values */
- u_int bios_apm_detail;
- u_int bios_apm_code32_base;
- u_int bios_apm_code16_base;
- u_int bios_apm_code_len;
- u_int bios_apm_data_base;
- u_int bios_apm_data_len;
- u_int bios_apm_entry;
-
- void *boot_data;
-} BIOS_vars;
-
-extern struct BIOS_regs {
- u_int32_t biosr_ax;
- u_int32_t biosr_cx;
- u_int32_t biosr_dx;
- u_int32_t biosr_bx;
- u_int32_t biosr_bp;
- u_int32_t biosr_si;
- u_int32_t biosr_di;
- u_int32_t biosr_ds;
- u_int32_t biosr_es;
-} BIOS_regs;
-
-struct EDD_CB {
- u_int8_t edd_len; /* size of packet */
- u_int8_t edd_res; /* reserved */
- u_int16_t edd_nblk; /* # of blocks to transfer */
- u_int32_t edd_buf; /* address of buffer */
- u_int64_t edd_daddr; /* starting block */
-};
-
+#define BOOTARG_MEMMAP 0
typedef struct _bios_memmap {
u_int64_t addr; /* Beginning of block */
u_int64_t size; /* Size of block */
@@ -138,53 +90,73 @@ typedef struct _bios_memmap {
* of a dependance on BIOSN*() macros having to be the same
* across /boot, /bsd, and userland.
*/
+#define BOOTARG_DISKINFO 1
typedef struct _bios_diskinfo {
/* BIOS section */
- signed int bios_number; /* BIOS number of drive (or -1) */
- unsigned int bios_cylinders; /* BIOS cylinders */
- unsigned int bios_heads; /* BIOS heads */
- unsigned int bios_sectors; /* BIOS sectors */
+ int bios_number; /* BIOS number of drive (or -1) */
+ u_int bios_cylinders; /* BIOS cylinders */
+ u_int bios_heads; /* BIOS heads */
+ u_int bios_sectors; /* BIOS sectors */
+ int bios_edd; /* EDD support */
/* BSD section */
- dev_t bsd_dev; /* BSD device */
+ dev_t bsd_dev; /* BSD device */
/* Checksum section */
- u_int32_t checksum; /* Checksum for drive */
- unsigned int checklen; /* Number of sectors done */
+ u_int32_t checksum; /* Checksum for drive */
+ u_int checklen; /* Number of sectors done */
+
} bios_diskinfo_t;
+#define BOOTARG_APMINFO 2
+typedef struct _bios_apminfo {
+ /* APM_CONNECT returned values */
+ u_int apm_detail;
+ u_int apm_code32_base;
+ u_int apm_code16_base;
+ u_int apm_code_len;
+ u_int apm_data_base;
+ u_int apm_data_len;
+ u_int apm_entry;
+} bios_apminfo_t;
+
+#if defined(_KERNEL) || defined (_STANDALONE)
+
+#ifdef _LOCORE
+#define DOINT(n) int $0x20+(n)
+#else
+#define DOINT(n) "int $0x20+(" #n ")"
+
+extern struct BIOS_regs {
+ u_int32_t biosr_ax;
+ u_int32_t biosr_cx;
+ u_int32_t biosr_dx;
+ u_int32_t biosr_bx;
+ u_int32_t biosr_bp;
+ u_int32_t biosr_si;
+ u_int32_t biosr_di;
+ u_int32_t biosr_ds;
+ u_int32_t biosr_es;
+} BIOS_regs;
#ifdef _KERNEL
#include <machine/bus.h>
struct bios_attach_args {
char *bios_dev;
+ u_int bios_func;
union {
struct {
bus_space_tag_t _bios_iot;
bus_space_tag_t _bios_memt;
} bios;
- struct {
- u_int _apm_detail;
- u_int _apm_code32_base;
- u_int _apm_code16_base;
- u_int _apm_code_len;
- u_int _apm_data_base;
- u_int _apm_data_len;
- u_int _apm_entry;
- } apm;
+ bios_apminfo_t *_bios_apmp;
} _;
};
#define bios_iot _.bios._bios_iot
#define bios_memt _.bios._bios_memt
-#define apm_detail _.apm._apm_detail
-#define apm_code32_base _.apm._apm_code32_base
-#define apm_code16_base _.apm._apm_code16_base
-#define apm_code_len _.apm._apm_code_len
-#define apm_data_base _.apm._apm_data_base
-#define apm_data_len _.apm._apm_data_len
-#define apm_entry _.apm._apm_entry
+#define bios_apmp _._bios_apmp
struct consdev;
struct proc;