Fixed a bug in do_sdevio() that broke I/O size computations.

Removed redundant size computations.
Cleaned up code.
This commit is contained in:
Kees van Reeuwijk 2010-01-14 14:51:23 +00:00
parent 5459f3a607
commit da3b64d8bc
2 changed files with 13 additions and 25 deletions

View file

@ -21,8 +21,9 @@
/*===========================================================================*
* do_sdevio *
*===========================================================================*/
PUBLIC int do_sdevio(m_ptr)
register message *m_ptr; /* pointer to request message */
PUBLIC int do_sdevio(
register message *m_ptr /* pointer to request message */
)
{
vir_bytes newoffset;
endpoint_t newep;
@ -30,7 +31,7 @@ register message *m_ptr; /* pointer to request message */
int count = m_ptr->DIO_VEC_SIZE;
long port = m_ptr->DIO_PORT;
phys_bytes phys_buf;
int i, req_type, req_dir, io_type, size, nr_io_range;
int i, req_type, req_dir, size, nr_io_range;
struct proc *rp;
struct priv *privp;
struct io_range *iorp;
@ -103,7 +104,7 @@ register message *m_ptr; /* pointer to request message */
vm_set_cr3(destproc);
switch (io_type)
switch (req_type)
{
case _DIO_BYTE: size= 1; break;
case _DIO_WORD: size= 2; break;
@ -115,13 +116,6 @@ register message *m_ptr; /* pointer to request message */
privp= priv(rp);
if (privp && privp->s_flags & CHECK_IO_PORT)
{
switch (io_type)
{
case _DIO_BYTE: size= 1; break;
case _DIO_WORD: size= 2; break;
case _DIO_LONG: size= 4; break;
default: size= 4; break; /* Be conservative */
}
port= m_ptr->DIO_PORT;
nr_io_range= privp->s_nr_io_range;
for (i= 0, iorp= privp->s_io_tab; i<nr_io_range; i++, iorp++)

View file

@ -17,8 +17,9 @@
/*===========================================================================*
* do_devio *
*===========================================================================*/
PUBLIC int do_devio(m_ptr)
register message *m_ptr; /* pointer to request message */
PUBLIC int do_devio(
register message *m_ptr /* pointer to request message */
)
{
struct proc *rp;
struct priv *privp;
@ -47,13 +48,6 @@ register message *m_ptr; /* pointer to request message */
}
if (privp->s_flags & CHECK_IO_PORT)
{
switch (io_type)
{
case _DIO_BYTE: size= 1; break;
case _DIO_WORD: size= 2; break;
case _DIO_LONG: size= 4; break;
default: size= 4; break; /* Be conservative */
}
port= m_ptr->DIO_PORT;
nr_io_range= privp->s_nr_io_range;
for (i= 0, iorp= privp->s_io_tab; i<nr_io_range; i++, iorp++)