Submit #2867 ยป 0001-boot-libi386-use-macros-from-machine-psl.h-to-repres.patch
sys/boot/pc32/libi386/biosdisk.c | ||
---|---|---|
#include <sys/diskmbr.h>
|
||
#include <sys/dtype.h>
|
||
#include <machine/bootinfo.h>
|
||
#include <machine/psl.h>
|
||
#include <stdarg.h>
|
||
... | ... | |
v86.edx = bd->bd_unit;
|
||
v86int();
|
||
|
||
if (!(v86.efl & 0x1) && /* carry clear */
|
||
if (!(v86.efl & PSL_C) && /* carry clear */
|
||
((v86.edx & 0xff) > ((unsigned)bd->bd_unit & 0x7f))) { /* unit # OK */
|
||
/*
|
||
... | ... | |
v86.edx = bd->bd_unit;
|
||
v86.ebx = 0x55aa;
|
||
v86int();
|
||
if (!(v86.efl & 0x1) && /* carry clear */
|
||
if (!(v86.efl & PSL_C) && /* carry clear */
|
||
((v86.ebx & 0xffff) == 0xaa55) && /* signature */
|
||
(v86.ecx & 0x1)) { /* packets mode ok */
|
||
bd->bd_flags |= BD_MODEEDD1;
|
||
... | ... | |
v86.ds = VTOPSEG(packet);
|
||
v86.esi = VTOPOFF(packet);
|
||
v86int();
|
||
result = (v86.efl & 0x1);
|
||
result = (v86.efl & PSL_C);
|
||
if (result == 0)
|
||
break;
|
||
} else if (cyl < 1024) {
|
||
... | ... | |
v86.es = VTOPSEG(xp);
|
||
v86.ebx = VTOPOFF(xp);
|
||
v86int();
|
||
result = (v86.efl & 0x1);
|
||
result = (v86.efl & PSL_C);
|
||
if (result == 0)
|
||
break;
|
||
} else {
|
||
... | ... | |
v86.ds = VTOPSEG(packet);
|
||
v86.esi = VTOPOFF(packet);
|
||
v86int();
|
||
result = (v86.efl & 0x1);
|
||
result = (v86.efl & PSL_C);
|
||
if (result == 0)
|
||
break;
|
||
} else if (cyl < 1024) {
|
||
... | ... | |
v86.es = VTOPSEG(xp);
|
||
v86.ebx = VTOPOFF(xp);
|
||
v86int();
|
||
result = (v86.efl & 0x1);
|
||
result = (v86.efl & PSL_C);
|
||
if (result == 0)
|
||
break;
|
||
} else {
|
||
... | ... | |
v86.edx = od->od_unit;
|
||
v86int();
|
||
if ((v86.efl & 0x1) || /* carry set */
|
||
if ((v86.efl & PSL_C) || /* carry set */
|
||
((v86.edx & 0xff) <= (unsigned)(od->od_unit & 0x7f))) /* unit # bad */
|
||
return(1);
|
||
|
||
... | ... | |
v86.eax = 0x800;
|
||
v86.edx = 0x80 + bunit;
|
||
v86int();
|
||
if (v86.efl & 0x1)
|
||
if (v86.efl & PSL_C)
|
||
return 0x4f010f;
|
||
return ((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) |
|
||
(v86.edx & 0xff00) | (v86.ecx & 0x3f);
|
sys/boot/pc32/libi386/biosmem.c | ||
---|---|---|
* Obtain memory configuration information from the BIOS
|
||
*/
|
||
#include <stand.h>
|
||
#include <machine/psl.h>
|
||
#include "libi386.h"
|
||
#include "btxv86.h"
|
||
... | ... | |
(int)(smap.base >> 32), (int)smap.base,
|
||
(int)(smap.length >> 32), (int)smap.length);
|
||
#endif
|
||
if ((v86.efl & 1) || (v86.eax != SMAPSIG))
|
||
if ((v86.efl & PSL_C) || (v86.eax != SMAPSIG))
|
||
break;
|
||
/* look for a low-memory segment that's large enough */
|
||
if ((smap.type == 1) && (smap.base == 0) && (smap.length >= (512 * 1024))) {
|
||
... | ... | |
v86.addr = 0x15; /* int 0x15 function 0xe801*/
|
||
v86.eax = 0xe801;
|
||
v86int();
|
||
if (!(v86.efl & 1)) {
|
||
if (!(v86.efl & PSL_C)) {
|
||
v = ((v86.ecx & 0xffff) +
|
||
((int64_t)(v86.edx & 0xffff) * 64)) * 1024;
|
||
if (v > 0x40000000)
|
sys/boot/pc32/libi386/biospci.c | ||
---|---|---|
#include <stand.h>
|
||
#include <machine/stdarg.h>
|
||
#include <machine/psl.h>
|
||
#include <bootstrap.h>
|
||
#include <isapnp.h>
|
||
#include <btxv86.h>
|
||
... | ... | |
v86int();
|
||
/* Check for OK response */
|
||
if ((v86.efl & 1) || ((v86.eax & 0xff00) != 0) || (v86.edx != 0x20494350))
|
||
if ((v86.efl & PSL_C) || ((v86.eax & 0xff00) != 0) || (v86.edx != 0x20494350))
|
||
return;
|
||
biospci_version = v86.ebx & 0xffff;
|
||
... | ... | |
v86.esi = device_index;
|
||
v86int();
|
||
/* error/end of matches */
|
||
if ((v86.efl & 1) || (v86.eax & 0xff00))
|
||
if ((v86.efl & PSL_C) || (v86.eax & 0xff00))
|
||
break;
|
||
/* Got something */
|
||
... | ... | |
v86.edi = 0x0;
|
||
v86int();
|
||
/* error */
|
||
if ((v86.efl & 1) || (v86.eax & 0xff00))
|
||
if ((v86.efl & PSL_C) || (v86.eax & 0xff00))
|
||
break;
|
||
|
||
/* We have the device ID, create a PnP object and save everything */
|
sys/boot/pc32/libi386/biossmap.c | ||
---|---|---|
#include <sys/param.h>
|
||
#include <sys/linker.h>
|
||
#include <machine/metadata.h>
|
||
#include <machine/psl.h>
|
||
#include "bootstrap.h"
|
||
#include "libi386.h"
|
||
#include "btxv86.h"
|
||
... | ... | |
v86.es = VTOPSEG(&smap);
|
||
v86.edi = VTOPOFF(&smap);
|
||
v86int();
|
||
if ((v86.efl & 1) || (v86.eax != SMAPSIG))
|
||
if ((v86.efl & PSL_C) || (v86.eax != SMAPSIG))
|
||
break;
|
||
n++;
|
||
} while (v86.ebx != 0);
|
||
... | ... | |
smapbase[smaplen] = smap;
|
||
++smaplen;
|
||
}
|
||
if ((v86.efl & 1) || (v86.eax != SMAPSIG))
|
||
if ((v86.efl & PSL_C) || (v86.eax != SMAPSIG))
|
||
break;
|
||
} while (v86.ebx != 0 && smaplen < n);
|
||
}
|