Project

General

Profile

0001-boot-libi386-use-macros-from-machine-psl.h-to-repres.patch

Anonymous, 12/18/2015 10:07 AM

View differences:

sys/boot/pc32/libi386/biosdisk.c
43 43
#include <sys/diskmbr.h>
44 44
#include <sys/dtype.h>
45 45
#include <machine/bootinfo.h>
46
#include <machine/psl.h>
46 47

  
47 48
#include <stdarg.h>
48 49

  
......
215 216
    v86.edx = bd->bd_unit;
216 217
    v86int();
217 218
    
218
    if (!(v86.efl & 0x1) &&				/* carry clear */
219
    if (!(v86.efl & PSL_C) &&				/* carry clear */
219 220
	((v86.edx & 0xff) > ((unsigned)bd->bd_unit & 0x7f))) {	/* unit # OK */
220 221

  
221 222
	/*
......
235 236
	v86.edx = bd->bd_unit;
236 237
	v86.ebx = 0x55aa;
237 238
	v86int();
238
	if (!(v86.efl & 0x1) &&				/* carry clear */
239
	if (!(v86.efl & PSL_C) &&				/* carry clear */
239 240
	    ((v86.ebx & 0xffff) == 0xaa55) &&		/* signature */
240 241
	    (v86.ecx & 0x1)) {				/* packets mode ok */
241 242
	    bd->bd_flags |= BD_MODEEDD1;
......
1099 1100
		v86.ds = VTOPSEG(packet);
1100 1101
		v86.esi = VTOPOFF(packet);
1101 1102
		v86int();
1102
		result = (v86.efl & 0x1);
1103
		result = (v86.efl & PSL_C);
1103 1104
		if (result == 0)
1104 1105
		    break;
1105 1106
	    } else if (cyl < 1024) {
......
1112 1113
		v86.es = VTOPSEG(xp);
1113 1114
		v86.ebx = VTOPOFF(xp);
1114 1115
		v86int();
1115
		result = (v86.efl & 0x1);
1116
		result = (v86.efl & PSL_C);
1116 1117
		if (result == 0)
1117 1118
		    break;
1118 1119
	    } else {
......
1250 1251
		v86.ds = VTOPSEG(packet);
1251 1252
		v86.esi = VTOPOFF(packet);
1252 1253
		v86int();
1253
		result = (v86.efl & 0x1);
1254
		result = (v86.efl & PSL_C);
1254 1255
		if (result == 0)
1255 1256
		    break;
1256 1257
	    } else if (cyl < 1024) {
......
1263 1264
		v86.es = VTOPSEG(xp);
1264 1265
		v86.ebx = VTOPOFF(xp);
1265 1266
		v86int();
1266
		result = (v86.efl & 0x1);
1267
		result = (v86.efl & PSL_C);
1267 1268
		if (result == 0)
1268 1269
		    break;
1269 1270
	    } else {
......
1293 1294
    v86.edx = od->od_unit;
1294 1295
    v86int();
1295 1296

  
1296
    if ((v86.efl & 0x1) ||				/* carry set */
1297
    if ((v86.efl & PSL_C) ||				/* carry set */
1297 1298
	((v86.edx & 0xff) <= (unsigned)(od->od_unit & 0x7f)))	/* unit # bad */
1298 1299
	return(1);
1299 1300
    
......
1330 1331
    v86.eax = 0x800;
1331 1332
    v86.edx = 0x80 + bunit;
1332 1333
    v86int();
1333
    if (v86.efl & 0x1)
1334
    if (v86.efl & PSL_C)
1334 1335
	return 0x4f010f;
1335 1336
    return ((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) |
1336 1337
	   (v86.edx & 0xff00) | (v86.ecx & 0x3f);
sys/boot/pc32/libi386/biosmem.c
30 30
 * Obtain memory configuration information from the BIOS
31 31
 */
32 32
#include <stand.h>
33
#include <machine/psl.h>
33 34
#include "libi386.h"
34 35
#include "btxv86.h"
35 36

  
......
74 75
		(int)(smap.base >> 32), (int)smap.base,
75 76
		(int)(smap.length >> 32), (int)smap.length);
76 77
#endif
77
	if ((v86.efl & 1) || (v86.eax != SMAPSIG))
78
	if ((v86.efl & PSL_C) || (v86.eax != SMAPSIG))
78 79
	    break;
79 80
	/* look for a low-memory segment that's large enough */
80 81
	if ((smap.type == 1) && (smap.base == 0) && (smap.length >= (512 * 1024))) {
......
103 104
	v86.addr = 0x15;		/* int 0x15 function 0xe801*/
104 105
	v86.eax = 0xe801;
105 106
	v86int();
106
	if (!(v86.efl & 1)) {
107
	if (!(v86.efl & PSL_C)) {
107 108
	    v = ((v86.ecx & 0xffff) +
108 109
		((int64_t)(v86.edx & 0xffff) * 64)) * 1024;
109 110
	    if (v > 0x40000000)
sys/boot/pc32/libi386/biospci.c
33 33

  
34 34
#include <stand.h>
35 35
#include <machine/stdarg.h>
36
#include <machine/psl.h>
36 37
#include <bootstrap.h>
37 38
#include <isapnp.h>
38 39
#include <btxv86.h>
......
212 213
    v86int();
213 214

  
214 215
    /* Check for OK response */
215
    if ((v86.efl & 1) || ((v86.eax & 0xff00) != 0) || (v86.edx != 0x20494350))
216
    if ((v86.efl & PSL_C) || ((v86.eax & 0xff00) != 0) || (v86.edx != 0x20494350))
216 217
	return;
217 218

  
218 219
    biospci_version = v86.ebx & 0xffff;
......
240 241
		    v86.esi = device_index;
241 242
		    v86int();
242 243
		    /* error/end of matches */
243
		    if ((v86.efl & 1) || (v86.eax & 0xff00))
244
		    if ((v86.efl & PSL_C) || (v86.eax & 0xff00))
244 245
			break;
245 246

  
246 247
		    /* Got something */
......
254 255
		    v86.edi = 0x0;
255 256
		    v86int();
256 257
		    /* error */
257
		    if ((v86.efl & 1) || (v86.eax & 0xff00))
258
		    if ((v86.efl & PSL_C) || (v86.eax & 0xff00))
258 259
			break;
259 260
		    
260 261
		    /* We have the device ID, create a PnP object and save everything */
sys/boot/pc32/libi386/biossmap.c
33 33
#include <sys/param.h>
34 34
#include <sys/linker.h>
35 35
#include <machine/metadata.h>
36
#include <machine/psl.h>
36 37
#include "bootstrap.h"
37 38
#include "libi386.h"
38 39
#include "btxv86.h"
......
68 69
		v86.es = VTOPSEG(&smap);
69 70
		v86.edi = VTOPOFF(&smap);
70 71
		v86int();
71
		if ((v86.efl & 1) || (v86.eax != SMAPSIG))
72
		if ((v86.efl & PSL_C) || (v86.eax != SMAPSIG))
72 73
			break;
73 74
		n++;
74 75
	} while (v86.ebx != 0);
......
121 122
			smapbase[smaplen] = smap;
122 123
			++smaplen;
123 124
		}
124
		if ((v86.efl & 1) || (v86.eax != SMAPSIG))
125
		if ((v86.efl & PSL_C) || (v86.eax != SMAPSIG))
125 126
			break;
126 127
	} while (v86.ebx != 0 && smaplen < n);
127 128
}
128
-