mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-27 07:44:09 +02:00
changes from Japheth (HXDOS)
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1170 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
92bb87ffaf
commit
d442e92e65
@ -255,11 +255,16 @@ static void interrupt far handler2f(intregs_t iregs) {
|
|||||||
if ((iregs.ax & 0xfe) == 0xa2) {
|
if ((iregs.ax & 0xfe) == 0xa2) {
|
||||||
iregs.ax = access_check
|
iregs.ax = access_check
|
||||||
(iregs.bx,
|
(iregs.bx,
|
||||||
iregs.cx,
|
iregs.cx,
|
||||||
|
#if 0
|
||||||
( ((((unsigned long)iregs.si)<<16) & 0xffff0000L) |
|
( ((((unsigned long)iregs.si)<<16) & 0xffff0000L) |
|
||||||
(((unsigned long)iregs.di) & 0xffffL) ),
|
(((unsigned long)iregs.di) & 0xffffL) ),
|
||||||
( ((((unsigned long)iregs.es)<<16) & 0xffff0000L) |
|
( ((((unsigned long)iregs.es)<<16) & 0xffff0000L) |
|
||||||
(((unsigned long)iregs.dx) & 0xffffL) ),
|
(((unsigned long)iregs.dx) & 0xffffL) ),
|
||||||
|
#else
|
||||||
|
( (((unsigned long)iregs.si)<<16) + iregs.di ),
|
||||||
|
( (((unsigned long)iregs.es)<<16) + iregs.dx ),
|
||||||
|
#endif
|
||||||
(iregs.ax & 0x01));
|
(iregs.ax & 0x01));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -268,11 +273,16 @@ static void interrupt far handler2f(intregs_t iregs) {
|
|||||||
if ((iregs.ax & 0xfe) == 0xa4) {
|
if ((iregs.ax & 0xfe) == 0xa4) {
|
||||||
iregs.ax = lock_unlock
|
iregs.ax = lock_unlock
|
||||||
(iregs.bx,
|
(iregs.bx,
|
||||||
iregs.cx,
|
iregs.cx,
|
||||||
|
#if 0
|
||||||
( ((((unsigned long)iregs.si)<<16) & 0xffff0000L) |
|
( ((((unsigned long)iregs.si)<<16) & 0xffff0000L) |
|
||||||
(((unsigned long)iregs.di) & 0xffffL) ),
|
(((unsigned long)iregs.di) & 0xffffL) ),
|
||||||
( ((((unsigned long)iregs.es)<<16) & 0xffff0000L) |
|
( ((((unsigned long)iregs.es)<<16) & 0xffff0000L) |
|
||||||
(((unsigned long)iregs.dx) & 0xffffL) ),
|
(((unsigned long)iregs.dx) & 0xffffL) ),
|
||||||
|
#else
|
||||||
|
( (((unsigned long)iregs.si)<<16) | ((unsigned long)iregs.di) ),
|
||||||
|
( (((unsigned long)iregs.es)<<16) | ((unsigned long)iregs.dx) ),
|
||||||
|
#endif
|
||||||
(iregs.ax & 0x01));
|
(iregs.ax & 0x01));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -522,13 +532,16 @@ static int lock_unlock
|
|||||||
lock_t *lptr;
|
lock_t *lptr;
|
||||||
unsigned long endofs = ofs + len;
|
unsigned long endofs = ofs + len;
|
||||||
|
|
||||||
if (endofs < ofs) {
|
if (endofs < ofs) {
|
||||||
endofs = 0xffffffffL;
|
endofs = 0xffffffffL;
|
||||||
len = endofs-ofs;
|
len = endofs-ofs;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < 1L) return 0;
|
if (len < 1L) return 0;
|
||||||
|
|
||||||
|
/* there was a error in the code below preventing any other
|
||||||
|
than the first locked region to be unlocked (japheth, 09/2005) */
|
||||||
|
|
||||||
if (unlock) {
|
if (unlock) {
|
||||||
for (i = 0; i < lock_table_size; i++) {
|
for (i = 0; i < lock_table_size; i++) {
|
||||||
lptr = &lock_table[i];
|
lptr = &lock_table[i];
|
||||||
@ -540,10 +553,9 @@ static int lock_unlock
|
|||||||
lptr->used = 0;
|
lptr->used = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Not already locked by us; can't unlock. */
|
|
||||||
return -(0x21); /* lock violation */
|
|
||||||
}
|
}
|
||||||
return -(0x24); /* sharing buffer overflow */
|
/* Not already locked by us; can't unlock. */
|
||||||
|
return -(0x21); /* lock violation */
|
||||||
} else {
|
} else {
|
||||||
if (access_check(0, fileno, ofs, len, 0)) {
|
if (access_check(0, fileno, ofs, len, 0)) {
|
||||||
/* Already locked; can't lock. */
|
/* Already locked; can't lock. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user