Remove add_far. adjust_far can do the job.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@813 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-03-22 16:38:46 +00:00
parent c73ee8084a
commit b0009452ee
3 changed files with 5 additions and 27 deletions

View File

@ -237,8 +237,7 @@ STATIC WORD diskchange(ddt * pddt)
{
COUNT result;
/* if it's a hard drive, media never changes */
if (hd(pddt->ddt_descflags))
if (hd(pddt->ddt_descflags) && !(pddt->ddt_descflags & DF_CHANGELINE))
return M_NOT_CHANGED;
if (play_dj(pddt) == M_CHANGED)
@ -983,6 +982,7 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
}
*/
buffer = adjust_far(buffer);
for (; totaltodo != 0;)
{
/* avoid overflowing 64K DMA boundary */
@ -1087,7 +1087,7 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
LBA_address += count;
totaltodo -= count;
buffer = add_far(buffer, count * 512);
buffer = adjust_far((char FAR *)buffer + count * 512);
}
return (error_code);

View File

@ -1629,7 +1629,7 @@ long rwblock(COUNT fd, VOID FAR * buffer, UCOUNT count, int mode)
secsize = fnp->f_dpb->dpb_secsize;
/* Adjust the far pointer from user space to supervisor space */
buffer = adjust_far((VOID FAR *) buffer);
buffer = adjust_far(buffer);
/* Do the data transfer. Use block transfer methods so that we */
/* can utilize memory management in future DOS-C versions. */
@ -1806,7 +1806,7 @@ long rwblock(COUNT fd, VOID FAR * buffer, UCOUNT count, int mode)
update_pointers:
ret_cnt += xfr_cnt;
to_xfer -= xfr_cnt;
buffer = add_far(buffer, xfr_cnt);
buffer = adjust_far((char FAR *)buffer + xfr_cnt);
if (mode == XFR_WRITE)
{
if (fnp->f_offset > fnp->f_dir.dir_size)

View File

@ -80,28 +80,6 @@ seg far2para(VOID FAR * p)
return FP_SEG(p) + (FP_OFF(p) >> 4);
}
/*
* Add a displacement to a far pointer and return the result normalized.
*/
void FAR * add_far(void FAR * fp, unsigned off)
{
unsigned segment, offset;
if (FP_SEG(fp) == 0xffff)
return ((char FAR *) fp) + off;
#ifndef I86
if (FP_SEG(fp) == 0)
return ((char FAR *) fp) + off;
#endif
offset = off + FP_OFF(fp);
segment = FP_SEG(fp) + (offset >> 4);
if (offset < off) /* forward carry without using a long */
segment += 0x1000;
return MK_FP(segment, offset & 0xf);
}
/*
* Return a normalized far pointer
*/