summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-03 06:58:49 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-03 06:58:49 (GMT)
commitc3275484580e8b5be08156bb08c85beee614b248 (patch)
treeda5c73c9de1bc0da2805fcfff64e50f217b8f4dc
parent7b098cc334a384fcb4fa339d9f728882b6251380 (diff)
downloadvirtio9p-c3275484580e8b5be08156bb08c85beee614b248.zip
virtio9p-c3275484580e8b5be08156bb08c85beee614b248.tar.gz
virtio9p-c3275484580e8b5be08156bb08c85beee614b248.tar.bz2
virtio9p-c3275484580e8b5be08156bb08c85beee614b248.tar.xz
Change to using symbolic offsets into DOS data structures
-rw-r--r--acc.S10
-rw-r--r--start.S10
-rw-r--r--v9fs.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/acc.S b/acc.S
index 4c77cec..dc10fd6 100644
--- a/acc.S
+++ b/acc.S
@@ -54,7 +54,7 @@ acc_always:
acc_file:
movw F_DI,%si
movw F_ES,%fs
- addw $5,%si /* Byte 5 in SFT entry = drive */
+ addw $SFT_DEVINFO,%si /* Byte 5 in SFT entry = drive */
/* fall through */
.size acc_file,.-acc_file
.type acc_file,@function
@@ -82,7 +82,7 @@ acc_drive_common:
.globl acc_findnext
acc_findnext:
lfsw dos_sdafn,%si
- addw $0x100,%si /* First byte in srcrec = drive no */
+ addw $SDF_SEARCHDATA,%si /* First byte in srcrec = drive no */
jmp acc_drive_common
.size acc_findnext,.-acc_findnext
@@ -117,12 +117,12 @@ fxn_unknown = acc_never
.globl acc_cds
acc_cds:
lfsw dos_sdafn,%si
- cmpw $CDS_MAGIC,%fs:(0x135 + 0x45)(%si) /* Our magic? */
+ cmpw $CDS_MAGIC,%fs:(SDF_CDS+CDS_DPBPTR)(%si) /* Our magic? */
jne acc_fail
movb drive_letter,%al
- cmpb %al,%fs:(0x135+0)(%si) /* Our drive letter? */
+ cmpb %al,%fs:(SDF_CDS+CDS_PATH+0)(%si) /* Our drive letter? */
jne acc_fail
- cmpw $0x5c3a,%fs:(0x135+1)(%si) /* Path starts with X:\? */
+ cmpw $0x5c3a,%fs:(SDF_CDS+CDS_PATH+1)(%si) /* Path starts with X:\? */
jne acc_fail
/* XXX: check for a character device */
/* CF = 0 if equal */
diff --git a/start.S b/start.S
index 65334d4..56f5f19 100644
--- a/start.S
+++ b/start.S
@@ -250,7 +250,7 @@ get_dos_bits:
movw %bx,our_cds
movw %es,our_cds+2
- movw %es:0x43(%bx),%dx /* Flags for the selected CDS */
+ movw %es:CDS_FLAGS(%bx),%dx /* Flags for the selected CDS */
popw %es
@@ -639,15 +639,15 @@ send_attach:
movw %es,int2f_chain+2
lesw our_cds,%bx
- andw $~0xf080,%es:0x43(%bx) /* Clear undesired flags */
- orb $0xc0,%es:0x44(%bx) /* Network drive, physical, real */
+ andw $~0xf080,%es:CDS_FLAGS(%bx) /* Clear undesired flags */
+ orb $0xc0,%es:(CDS_FLAGS+1)(%bx) /* Network drive, physical, real */
movl $0x005c3a00,%eax
movb drive_letter,%al /* Now %eax = "X:\" + NUL for the proper X */
movl %eax,%es:(%bx) /* Set current directory */
- movw $CDS_MAGIC,%es:0x45(%bx) /* Available field, set to magic */
- movw $2,%es:0x4f(%bx) /* Path starts after X: */
+ movw $CDS_MAGIC,%es:CDS_DPBPTR(%bx) /* Available field, set to magic */
+ movw $2,%es:CDS_ROOTOFFSET(%bx) /* Path starts after X: */
/* ------------------------------------------------------------------------- *
* Finish up and terminate
diff --git a/v9fs.h b/v9fs.h
index fcb0785..7c52021 100644
--- a/v9fs.h
+++ b/v9fs.h
@@ -280,7 +280,7 @@
#define SFT_HANDLES 0x00 /* Count of file handles */
#define SFT_MODE 0x02 /* File open mode per INT 21h, AH=3Dh */
#define SFT_ATTRIB 0x04 /* File attribute */
-#define SFT_DEVINFO 0x05 /* Device info word */
+#define SFT_DEVINFO 0x05 /* Device info word (includes drive #) */
#define SFT_DPBPTR 0x07 /* Drive Parameter Block pointer */
#define SFT_CLUSTER 0x0b /* Starting cluster */
#define SFT_DATETIME 0x0d /* date:time */