mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-29 22:49:32 +08:00
GRSPW: fixed SET_RMAPEN and SET_RMAPBUFDIS
Both ioctl commands destroyed the control register by writing the content of the status register into it.
This commit is contained in:
@@ -1138,7 +1138,7 @@ static rtems_device_driver grspw_control(
|
||||
if ((unsigned int)ioarg->buffer > 1) {
|
||||
return RTEMS_INVALID_NAME;
|
||||
}
|
||||
SPW_CTRL_WRITE(pDev, (SPW_STATUS_READ(pDev) & 0xFFFEFFFF) | ((unsigned int)ioarg->buffer << 16));
|
||||
SPW_CTRL_WRITE(pDev, (SPW_CTRL_READ(pDev) & 0xFFFEFFFF) | ((unsigned int)ioarg->buffer << 16));
|
||||
if (((SPW_CTRL_READ(pDev) >> 16) & 1) != (unsigned int)ioarg->buffer) {
|
||||
return RTEMS_IO_ERROR;
|
||||
}
|
||||
@@ -1149,7 +1149,7 @@ static rtems_device_driver grspw_control(
|
||||
if ((unsigned int)ioarg->buffer > 1) {
|
||||
return RTEMS_INVALID_NAME;
|
||||
}
|
||||
SPW_CTRL_WRITE(pDev, (SPW_STATUS_READ(pDev) & 0xFFFDFFFF) | ((unsigned int)ioarg->buffer << 17));
|
||||
SPW_CTRL_WRITE(pDev, (SPW_CTRL_READ(pDev) & 0xFFFDFFFF) | ((unsigned int)ioarg->buffer << 17));
|
||||
if (((SPW_CTRL_READ(pDev) >> 17) & 1) != (unsigned int)ioarg->buffer) {
|
||||
return RTEMS_IO_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user