Massive renames for consistency:
biosdiskreset -> biosdisk_reset biosread -> biosdisk_read get_diskinfo -> biosdisk_getinfo int13_extension -> biosdisk_int13ext biosextread -> biosdisk_extread int13_getextinfo -> biosdisk_getextinfo struct biosdisk_ext13info -> biosdisk_extinfo BIOSDISK_EXT13 -> BIOSDISK_INT13EXT BIOSDISK_EXT13INFO_V{2,3} -> BIOSDISK_EXTINFO_V{2,3} EXT13_* -> EXTINFO_*
This commit is contained in:
parent
beeb6c877c
commit
f10ef234b8
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bios_disk.S,v 1.16 2005/06/29 18:02:52 junyoung Exp $ */
|
||||
/* $NetBSD: bios_disk.S,v 1.17 2005/06/29 18:50:38 junyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Ported to boot 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
|
||||
|
@ -62,7 +62,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
* Return:
|
||||
* %al = 0x0 on success; err code on failure
|
||||
*/
|
||||
ENTRY(biosdiskreset)
|
||||
ENTRY(biosdisk_reset)
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
pushl %ebx
|
||||
|
@ -103,12 +103,12 @@ ENTRY(biosdiskreset)
|
|||
* Return:
|
||||
* %al = 0x0 on success; err code on failure
|
||||
*
|
||||
* biosread( dev, cyl, head, sect, count, buff_addr );
|
||||
* biosdisk_read(dev, cyl, head, sect, count, buff_addr);
|
||||
*
|
||||
* Note: On failure, you must reset the disk with biosdiskreset() before
|
||||
* Note: On failure, you must reset the disk with biosdisk_reset() before
|
||||
* sending another command.
|
||||
*/
|
||||
ENTRY(biosread)
|
||||
ENTRY(biosdisk_read)
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
pushl %ebx
|
||||
|
@ -157,10 +157,10 @@ ENTRY(biosread)
|
|||
ret
|
||||
|
||||
/*
|
||||
* get_diskinfo(): return a word that represents the
|
||||
* biosdisk_getinfo(int dev): return a word that represents the
|
||||
* max number of sectors, heads and cylinders for this device
|
||||
*/
|
||||
ENTRY(get_diskinfo)
|
||||
ENTRY(biosdisk_getinfo)
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
push %es
|
||||
|
@ -221,9 +221,10 @@ ok:
|
|||
ret
|
||||
|
||||
/*
|
||||
* int13_extension: check for availibility of int13 extensions.
|
||||
* int biosdisk_int13ext(int dev):
|
||||
* check for availibility of int13 extensions.
|
||||
*/
|
||||
ENTRY(int13_extension)
|
||||
ENTRY(biosdisk_int13ext)
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
pushl %ebx
|
||||
|
@ -271,7 +272,7 @@ ENTRY(int13_extension)
|
|||
* Return:
|
||||
* %al = 0x0 on success; err code on failure
|
||||
*/
|
||||
ENTRY(biosextread)
|
||||
ENTRY(biosdisk_extread)
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
pushl %ebx
|
||||
|
@ -312,7 +313,7 @@ ENTRY(biosextread)
|
|||
popl %ebp
|
||||
ret
|
||||
|
||||
ENTRY(int13_getextinfo)
|
||||
ENTRY(biosdisk_getextinfo)
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
pushl %ebx
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: biosdisk_ll.c,v 1.22 2005/06/29 18:02:52 junyoung Exp $ */
|
||||
/* $NetBSD: biosdisk_ll.c,v 1.23 2005/06/29 18:50:38 junyoung Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
||||
|
@ -99,11 +99,11 @@ static int do_read(struct biosdisk_ll *, daddr_t, int, char *);
|
|||
#endif
|
||||
|
||||
int
|
||||
set_geometry(struct biosdisk_ll *d, struct biosdisk_ext13info *ed)
|
||||
set_geometry(struct biosdisk_ll *d, struct biosdisk_extinfo *ed)
|
||||
{
|
||||
int diskinfo;
|
||||
|
||||
diskinfo = get_diskinfo(d->dev);
|
||||
diskinfo = biosdisk_getinfo(d->dev);
|
||||
d->sec = SPT(diskinfo);
|
||||
d->head = HEADS(diskinfo);
|
||||
d->cyl = CYL(diskinfo);
|
||||
|
@ -130,11 +130,11 @@ set_geometry(struct biosdisk_ll *d, struct biosdisk_ext13info *ed)
|
|||
*/
|
||||
d->flags = 0;
|
||||
if (d->type == BIOSDISK_TYPE_CD ||
|
||||
(d->type == BIOSDISK_TYPE_HD && int13_extension(d->dev))) {
|
||||
d->flags |= BIOSDISK_EXT13;
|
||||
(d->type == BIOSDISK_TYPE_HD && biosdisk_int13ext(d->dev))) {
|
||||
d->flags |= BIOSDISK_INT13EXT;
|
||||
if (ed != NULL) {
|
||||
ed->size = sizeof(*ed);
|
||||
int13_getextinfo(d->dev, ed);
|
||||
biosdisk_getextinfo(d->dev, ed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ set_geometry(struct biosdisk_ll *d, struct biosdisk_ext13info *ed)
|
|||
if (d->type == BIOSDISK_TYPE_FD && SPT(diskinfo) == 36) {
|
||||
char buf[512];
|
||||
|
||||
if (biosread(d->dev, 0, 0, 18, 1, buf)) {
|
||||
if (biosdisk_read(d->dev, 0, 0, 18, 1, buf)) {
|
||||
d->sec = 18;
|
||||
d->chs_sectors /= 2;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ do_read(struct biosdisk_ll *d, daddr_t dblk, int num, char *buf)
|
|||
int64_t sec;
|
||||
} ext;
|
||||
|
||||
if (!(d->flags & BIOSDISK_EXT13))
|
||||
if (!(d->flags & BIOSDISK_INT13EXT))
|
||||
return -1;
|
||||
ext.size = sizeof(ext);
|
||||
ext.resvd = 0;
|
||||
|
@ -208,8 +208,8 @@ do_read(struct biosdisk_ll *d, daddr_t dblk, int num, char *buf)
|
|||
ext.seg = vtophys(buf) >> 4;
|
||||
ext.sec = dblk;
|
||||
|
||||
if (biosextread(d->dev, &ext)) {
|
||||
(void)biosdiskreset(d->dev);
|
||||
if (biosdisk_extread(d->dev, &ext)) {
|
||||
(void)biosdisk_reset(d->dev);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -227,8 +227,8 @@ do_read(struct biosdisk_ll *d, daddr_t dblk, int num, char *buf)
|
|||
if (nsec > num)
|
||||
nsec = num;
|
||||
|
||||
if (biosread(d->dev, cyl, head, sec, nsec, buf)) {
|
||||
(void)biosdiskreset(d->dev);
|
||||
if (biosdisk_read(d->dev, cyl, head, sec, nsec, buf)) {
|
||||
(void)biosdisk_reset(d->dev);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: biosdisk_ll.h,v 1.12 2005/06/23 20:20:37 junyoung Exp $ */
|
||||
/* $NetBSD: biosdisk_ll.h,v 1.13 2005/06/29 18:50:38 junyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -52,7 +52,7 @@ struct biosdisk_ll {
|
|||
int chs_sectors; /* # of sectors addressable by CHS */
|
||||
int secsize; /* bytes per sector */
|
||||
};
|
||||
#define BIOSDISK_EXT13 1 /* BIOS supports int13 extension */
|
||||
#define BIOSDISK_INT13EXT 1 /* BIOS supports int13 extension */
|
||||
|
||||
#define BIOSDISK_TYPE_FD 0
|
||||
#define BIOSDISK_TYPE_HD 1
|
||||
|
@ -65,7 +65,7 @@ struct biosdisk_ll {
|
|||
* - but are much less likely to be supported.
|
||||
*/
|
||||
|
||||
struct biosdisk_ext13info {
|
||||
struct biosdisk_extinfo {
|
||||
uint16_t size; /* size of buffer, set on call */
|
||||
uint16_t flags; /* flags, see below */
|
||||
uint32_t cyl; /* # of physical cylinders */
|
||||
|
@ -73,13 +73,13 @@ struct biosdisk_ext13info {
|
|||
uint32_t sec; /* # of physical sectors per track */
|
||||
uint64_t totsec; /* total number of sectors */
|
||||
uint16_t sbytes; /* # of bytes per sector */
|
||||
#if defined(BIOSDISK_EXT13INFO_V2) || defined(BIOSDISK_EXT13INFO_V3)
|
||||
#if defined(BIOSDISK_EXTINFO_V2) || defined(BIOSDISK_EXTINFO_V3)
|
||||
/* v2.0 extensions */
|
||||
uint32_t edd_cfg; /* EDD configuration parameters */
|
||||
#if defined(BIOSDISK_EXT13INFO_V3)
|
||||
#if defined(BIOSDISK_EXTINFO_V3)
|
||||
/* v3.0 extensions */
|
||||
uint16_t devpath_sig; /* 0xbedd if path info present */
|
||||
#define EXT13_DEVPATH_SIGNATURE 0xbedd
|
||||
#define EXTINFO_DEVPATH_SIGNATURE 0xbedd
|
||||
uint8_t devpath_len; /* length from devpath_sig */
|
||||
uint8_t fill21[3];
|
||||
char host_bus[4]; /* Probably "ISA" or "PCI" */
|
||||
|
@ -108,19 +108,19 @@ struct biosdisk_ext13info {
|
|||
#define dp_fibrechnl_wwn dp_64[0];
|
||||
uint8_t fill40[1];
|
||||
uint8_t checksum; /* byte sum from dev_path_sig is 0 */
|
||||
#endif /* BIOSDISK_EXT13INFO_V3 */
|
||||
#endif /* BIOSDISK_EXT13INFO_V2 */
|
||||
#endif /* BIOSDISK_EXTINFO_V3 */
|
||||
#endif /* BIOSDISK_EXTINFO_V2 */
|
||||
} __attribute__((packed));
|
||||
|
||||
#define EXT13_DMA_TRANS 0x0001 /* transparent DMA boundary errors */
|
||||
#define EXT13_GEOM_VALID 0x0002 /* geometry in c/h/s in struct valid */
|
||||
#define EXT13_REMOVABLE 0x0004 /* removable device */
|
||||
#define EXT13_WRITEVERF 0x0008 /* supports write with verify */
|
||||
#define EXT13_CHANGELINE 0x0010 /* changeline support */
|
||||
#define EXT13_LOCKABLE 0x0020 /* device is lockable */
|
||||
#define EXT13_MAXGEOM 0x0040 /* geometry set to max; no media */
|
||||
#define EXTINFO_DMA_TRANS 0x0001 /* transparent DMA boundary errors */
|
||||
#define EXTINFO_GEOM_VALID 0x0002 /* geometry in c/h/s in struct valid */
|
||||
#define EXTINFO_REMOVABLE 0x0004 /* removable device */
|
||||
#define EXTINFO_WRITEVERF 0x0008 /* supports write with verify */
|
||||
#define EXTINFO_CHANGELINE 0x0010 /* changeline support */
|
||||
#define EXTINFO_LOCKABLE 0x0020 /* device is lockable */
|
||||
#define EXTINFO_MAXGEOM 0x0040 /* geometry set to max; no media */
|
||||
|
||||
#define BIOSDISK_DEFAULT_SECSIZE 512
|
||||
|
||||
int set_geometry(struct biosdisk_ll *, struct biosdisk_ext13info *);
|
||||
int set_geometry(struct biosdisk_ll *, struct biosdisk_extinfo *);
|
||||
int readsects(struct biosdisk_ll *, daddr_t, int, char *, int);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bootinfo_biosgeom.c,v 1.17 2005/06/23 20:20:37 junyoung Exp $ */
|
||||
/* $NetBSD: bootinfo_biosgeom.c,v 1.18 2005/06/29 18:50:38 junyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
|
@ -37,7 +37,7 @@
|
|||
#include "biosdisk_ll.h"
|
||||
#include "bootinfo.h"
|
||||
|
||||
#ifdef BIOSDISK_EXT13INFO_V3
|
||||
#ifdef BIOSDISK_EXTINFO_V3
|
||||
static struct {
|
||||
char *name;
|
||||
int flag;
|
||||
|
@ -64,7 +64,7 @@ bi_getbiosgeom(void)
|
|||
int nhd;
|
||||
unsigned int cksum;
|
||||
struct biosdisk_ll d;
|
||||
struct biosdisk_ext13info ed;
|
||||
struct biosdisk_extinfo ed;
|
||||
char buf[BIOSDISK_DEFAULT_SECSIZE];
|
||||
|
||||
nhd = get_harddrives();
|
||||
|
@ -104,11 +104,11 @@ bi_getbiosgeom(void)
|
|||
ed.totsec, ed.sbytes);
|
||||
#endif
|
||||
|
||||
if (d.flags & BIOSDISK_EXT13) {
|
||||
if (d.flags & BIOSDISK_INT13EXT) {
|
||||
bibg->disk[nvalid].totsec = ed.totsec;
|
||||
bibg->disk[nvalid].flags |= BI_GEOM_EXTINT13;
|
||||
}
|
||||
#ifdef BIOSDISK_EXT13INFO_V3
|
||||
#ifdef BIOSDISK_EXTINFO_V3
|
||||
#ifdef GEOM_DEBUG
|
||||
printf(" edd_cfg %x, sig %x, len %x, bus %s type %s\n",
|
||||
ed.edd_cfg, ed.devpath_sig, ed.devpath_len,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: libi386.h,v 1.21 2005/06/22 20:40:59 dyoung Exp $ */
|
||||
/* $NetBSD: libi386.h,v 1.22 2005/06/29 18:50:38 junyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -97,11 +97,12 @@ void command_help(char *);
|
|||
extern const struct bootblk_command commands[];
|
||||
|
||||
/* asm bios/dos calls */
|
||||
int biosdiskreset(int);
|
||||
int biosextread(int, void *);
|
||||
int biosdisk_extread(int, void *);
|
||||
int biosdisk_read(int, int, int, int, int, void *);
|
||||
int biosdisk_reset(int);
|
||||
|
||||
int biosgetrtc(u_long *);
|
||||
int biosgetsystime(void);
|
||||
int biosread(int, int, int, int, int, void *);
|
||||
int comgetc(int);
|
||||
void cominit(int);
|
||||
int computc(int, int);
|
||||
|
@ -111,13 +112,14 @@ int conisshift(void);
|
|||
int coniskey(void);
|
||||
void conputc(int);
|
||||
|
||||
int get_diskinfo(int);
|
||||
int getextmem2(int *);
|
||||
int getextmemps2(void *);
|
||||
int getmementry(int *, int *);
|
||||
int int13_extension(int);
|
||||
struct biosdisk_ext13info;
|
||||
void int13_getextinfo(int, struct biosdisk_ext13info *);
|
||||
|
||||
int biosdisk_int13ext(int);
|
||||
int biosdisk_getinfo(int);
|
||||
struct biosdisk_extinfo;
|
||||
void biosdisk_getextinfo(int, struct biosdisk_extinfo *);
|
||||
int get_harddrives(void);
|
||||
|
||||
int pcibios_cfgread(unsigned int, int, int *);
|
||||
|
|
Loading…
Reference in New Issue