summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include/pc
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2000-09-29 13:48:14 +0000
committerdfr <dfr@FreeBSD.org>2000-09-29 13:48:14 +0000
commit70fa508eceff345606270a2d5580730213fc602a (patch)
treeb1883d611005ec193b41fb8d2b375f13c78bc599 /sys/ia64/include/pc
parent263f9f686317c48283eeb1e362d5f2b85791d899 (diff)
downloadFreeBSD-src-70fa508eceff345606270a2d5580730213fc602a.zip
FreeBSD-src-70fa508eceff345606270a2d5580730213fc602a.tar.gz
Add a few more files for the ia64 port.
Diffstat (limited to 'sys/ia64/include/pc')
-rw-r--r--sys/ia64/include/pc/bios.h117
-rw-r--r--sys/ia64/include/pc/display.h46
-rw-r--r--sys/ia64/include/pc/msdos.h66
-rw-r--r--sys/ia64/include/pc/vesa.h128
4 files changed, 357 insertions, 0 deletions
diff --git a/sys/ia64/include/pc/bios.h b/sys/ia64/include/pc/bios.h
new file mode 100644
index 0000000..d85f674
--- /dev/null
+++ b/sys/ia64/include/pc/bios.h
@@ -0,0 +1,117 @@
+/*-
+ * Copyright (c) 1997 Michael Smith
+ * 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
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 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$
+ * from: i386/include/pc bios.h,v 1.2
+ */
+
+/*
+ * Signature structure for the BIOS32 Service Directory header
+ */
+struct bios32_SDheader
+{
+ u_int8_t sig[4];
+ u_int32_t entry;
+ u_int8_t revision;
+ u_int8_t len;
+ u_int8_t cksum;
+ u_int8_t pad[5];
+};
+
+/*
+ * BIOS32 Service Directory entry. Caller supplies name, bios32_SDlookup
+ * fills in the rest of the details.
+ */
+struct bios32_SDentry
+{
+ union
+ {
+ u_int8_t name[4]; /* service identifier */
+ u_int32_t id; /* as a 32-bit value */
+ } ident;
+ u_int32_t base; /* base of service */
+ u_int32_t len; /* service length */
+ u_int32_t entry; /* entrypoint offset from base */
+};
+
+extern int bios32_SDlookup(struct bios32_SDentry *ent);
+extern u_int32_t bios_sigsearch(u_int32_t start, u_char *sig, int siglen,
+ int paralen, int sigofs);
+
+/*
+ * Call a 32-bit BIOS function
+ */
+struct bios32_args {
+ u_long eax;
+ u_long ebx;
+ u_long ecx;
+ u_long edx;
+};
+extern void bios32(caddr_t func_addr, struct bios32_args *args);
+
+#if 0
+#define BIOS_PADDRTOVADDR(x) (((x) - ISA_HOLE_START) + atdevbase)
+#define BIOS_VADDRTOPADDR(x) (((x) - atdevbase) + ISA_HOLE_START)
+#else
+#define BIOS_PADDRTOVADDR(x) (x)
+#define BIOS_VADDRTOPADDR(x) (x)
+#endif
+
+/*
+ * System Management BIOS / Desktop Management Interface tables
+ */
+
+struct DMI_table
+{
+ u_int8_t sig[5]; /* "_DMI_" */
+ u_int8_t cksum; /* checksum */
+ u_int16_t st_size; /* total length of SMBIOS table (bytes)*/
+ u_int32_t st_base; /* base address of the SMBIOS table (physical) */
+ u_int16_t st_entries; /* total number of structures present in the table */
+ u_int8_t bcd_revision; /* interface revision number */
+};
+
+struct SMBIOS_table
+{
+ u_int8_t sig[4]; /* "_SM_" */
+ u_int8_t cksum; /* checksum */
+ u_int8_t len; /* structure length */
+ u_int8_t major, minor; /* major/minor revision numbers */
+ u_int16_t st_maxsize; /* largest structure size (bytes) */
+ u_int8_t revision; /* entrypoint revision */
+ u_int8_t pad[5];
+ struct DMI_table dmi; /* follows immediately */
+};
+
+
+/*
+ * Exported lookup results
+ */
+extern struct bios32_SDentry PCIbios;
+extern struct SMBIOS_table *SMBIOS_table;
+extern struct DMI_table *DMI_table;
+
+
+
diff --git a/sys/ia64/include/pc/display.h b/sys/ia64/include/pc/display.h
new file mode 100644
index 0000000..fad568c
--- /dev/null
+++ b/sys/ia64/include/pc/display.h
@@ -0,0 +1,46 @@
+/*
+ * IBM PC display definitions
+ *
+ * $FreeBSD$
+ * from: i386/include/pc display.h,v 1.4
+ */
+
+/* Color attributes for foreground text */
+
+#define FG_BLACK 0
+#define FG_BLUE 1
+#define FG_GREEN 2
+#define FG_CYAN 3
+#define FG_RED 4
+#define FG_MAGENTA 5
+#define FG_BROWN 6
+#define FG_LIGHTGREY 7
+#define FG_DARKGREY 8
+#define FG_LIGHTBLUE 9
+#define FG_LIGHTGREEN 10
+#define FG_LIGHTCYAN 11
+#define FG_LIGHTRED 12
+#define FG_LIGHTMAGENTA 13
+#define FG_YELLOW 14
+#define FG_WHITE 15
+#define FG_BLINK 0x80
+
+/* Color attributes for text background */
+
+#define BG_BLACK 0x00
+#define BG_BLUE 0x10
+#define BG_GREEN 0x20
+#define BG_CYAN 0x30
+#define BG_RED 0x40
+#define BG_MAGENTA 0x50
+#define BG_BROWN 0x60
+#define BG_LIGHTGREY 0x70
+
+/* Monochrome attributes for foreground text */
+
+#define FG_UNDERLINE 0x01
+#define FG_INTENSE 0x08
+
+/* Monochrome attributes for text background */
+
+#define BG_INTENSE 0x10
diff --git a/sys/ia64/include/pc/msdos.h b/sys/ia64/include/pc/msdos.h
new file mode 100644
index 0000000..d1b777f
--- /dev/null
+++ b/sys/ia64/include/pc/msdos.h
@@ -0,0 +1,66 @@
+/*
+ * msdos common header file
+ * [obtained from mtools -wfj]
+ * how to decipher DOS disk structures in coexisting with DOS
+ *
+ * $FreeBSD$
+ * from: i386/include/pc msdos.h,v 1.4
+ */
+
+#define MSECTOR_SIZE 512 /* MSDOS sector size in bytes */
+#define MDIR_SIZE 32 /* MSDOS directory size in bytes */
+#define MAX_CLUSTER 8192 /* largest cluster size */
+#define MAX_PATH 128 /* largest MSDOS path length */
+#define MAX_DIR_SECS 64 /* largest directory (in sectors) */
+
+#define NEW 1
+#define OLD 0
+
+struct directory {
+ unsigned char name[8]; /* file name */
+ unsigned char ext[3]; /* file extension */
+ unsigned char attr; /* attribute byte */
+ unsigned char reserved[10]; /* ?? */
+ unsigned char time[2]; /* time stamp */
+ unsigned char date[2]; /* date stamp */
+ unsigned char start[2]; /* starting cluster number */
+ unsigned char size[4]; /* size of the file */
+};
+
+struct bootsector {
+ unsigned char jump[3]; /* Jump to boot code */
+ unsigned char banner[8]; /* OEM name & version */
+ unsigned char secsiz[2]; /* Bytes per sector hopefully 512 */
+ unsigned char clsiz; /* Cluster size in sectors */
+ unsigned char nrsvsect[2]; /* Number of reserved (boot) sectors */
+ unsigned char nfat; /* Number of FAT tables hopefully 2 */
+ unsigned char dirents[2]; /* Number of directory slots */
+ unsigned char psect[2]; /* Total sectors on disk */
+ unsigned char descr; /* Media descriptor=first byte of FAT */
+ unsigned char fatlen[2]; /* Sectors in FAT */
+ unsigned char nsect[2]; /* Sectors/track */
+ unsigned char nheads[2]; /* Heads */
+ unsigned char nhs[4]; /* number of hidden sectors */
+ unsigned char bigsect[4]; /* big total sectors */
+ unsigned char junk[476]; /* who cares? */
+};
+
+/* DOS partition table -- located in boot block */
+
+#define DOSBBSECTOR 0 /* DOS boot block relative sector number */
+#define DOSPARTOFF 446
+#define NDOSPART 4
+
+struct dos_partition {
+ unsigned char dp_flag; /* bootstrap flags */
+ unsigned char dp_shd; /* starting head */
+ unsigned char dp_ssect; /* starting sector */
+ unsigned char dp_scyl; /* starting cylinder */
+ unsigned char dp_typ; /* partition type */
+#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */
+ unsigned char dp_ehd; /* end head */
+ unsigned char dp_esect; /* end sector */
+ unsigned char dp_ecyl; /* end cylinder */
+ unsigned long dp_start; /* absolute starting sector number */
+ unsigned long dp_size; /* partition size in sectors */
+} dos_partitions[NDOSPART];
diff --git a/sys/ia64/include/pc/vesa.h b/sys/ia64/include/pc/vesa.h
new file mode 100644
index 0000000..96f027e
--- /dev/null
+++ b/sys/ia64/include/pc/vesa.h
@@ -0,0 +1,128 @@
+/*-
+ * Copyright (c) 1998 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
+ * 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
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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$
+ * from: i386/include/pc vesa.h,v 1.1
+ */
+
+#ifndef _MACHINE_PC_VESA_H
+#define _MACHINE_PC_VESA_H
+
+struct vesa_info
+{
+ /* mandatory fields */
+ u_int8_t v_sig[4] __attribute__ ((packed)); /* VESA */
+ u_int16_t v_version __attribute__ ((packed)); /* ver in BCD */
+ u_int32_t v_oemstr __attribute__ ((packed)); /* OEM string */
+ u_int32_t v_flags __attribute__ ((packed)); /* flags */
+#define V_DAC8 (1<<0)
+#define V_NONVGA (1<<1)
+#define V_SNOW (1<<2)
+ u_int32_t v_modetable __attribute__ ((packed)); /* modes */
+ u_int16_t v_memsize __attribute__ ((packed)); /* in 64K */
+ /* 2.0 */
+ u_int16_t v_revision __attribute__ ((packed)); /* software rev */
+ u_int32_t v_venderstr __attribute__ ((packed)); /* vender */
+ u_int32_t v_prodstr __attribute__ ((packed)); /* product name */
+ u_int32_t v_revstr __attribute__ ((packed)); /* product rev */
+};
+
+struct vesa_mode
+{
+ /* mandatory fields */
+ u_int16_t v_modeattr;
+#define V_MODESUPP (1<<0) /* VESA mode attributes */
+#define V_MODEOPTINFO (1<<1)
+#define V_MODEBIOSOUT (1<<2)
+#define V_MODECOLOR (1<<3)
+#define V_MODEGRAPHICS (1<<4)
+#define V_MODENONVGA (1<<5)
+#define V_MODENONBANK (1<<6)
+#define V_MODELFB (1<<7)
+#define V_MODEVESA (1<<16) /* Private attributes */
+ u_int8_t v_waattr;
+ u_int8_t v_wbattr;
+#define V_WATTREXIST (1<<0)
+#define V_WATTRREAD (1<<1)
+#define V_WATTRWRITE (1<<2)
+ u_int16_t v_wgran;
+ u_int16_t v_wsize;
+ u_int16_t v_waseg;
+ u_int16_t v_wbseg;
+ u_int32_t v_posfunc;
+ u_int16_t v_bpscanline;
+ /* fields optional for 1.0/1.1 implementations */
+ u_int16_t v_width;
+ u_int16_t v_height;
+ u_int8_t v_cwidth;
+ u_int8_t v_cheight;
+ u_int8_t v_planes;
+ u_int8_t v_bpp;
+ u_int8_t v_banks;
+ u_int8_t v_memmodel;
+#define V_MMTEXT 0
+#define V_MMCGA 1
+#define V_MMHGC 2
+#define V_MMEGA 3
+#define V_MMPACKED 4
+#define V_MMSEQU256 5
+#define V_MMDIRCOLOR 6
+#define V_MMYUV 7
+ u_int8_t v_banksize;
+ u_int8_t v_ipages;
+ u_int8_t v_reserved0;
+ /* fields for 1.2+ implementations */
+ u_int8_t v_redmasksize;
+ u_int8_t v_redfieldpos;
+ u_int8_t v_greenmasksize;
+ u_int8_t v_greenfieldpos;
+ u_int8_t v_bluemasksize;
+ u_int8_t v_bluefieldpos;
+ u_int8_t v_resmasksize;
+ u_int8_t v_resfieldpos;
+ u_int8_t v_dircolormode;
+ /* 2.0 implementations */
+ u_int32_t v_lfb;
+ u_int32_t v_offscreen;
+ u_int8_t v_offscreensize;
+};
+
+#ifdef _KERNEL
+
+#define VESA_MODE(x) ((x) >= M_VESA_BASE)
+
+int vesa_load_ioctl(void);
+int vesa_unload_ioctl(void);
+
+#ifndef VESA_MODULE
+int vesa_load(void);
+#endif
+
+#endif /* _KERNEL */
+
+#endif /* !_MACHINE_PC_VESA_H */
OpenPOWER on IntegriCloud