sync'ing the descriptor, leading to a race where the packet could complete
after the DMA check but before the sync of the descriptor, sending the code
into unknown territory and the DMA engine into space. Also, fix a bug with
spurious watchdog resets going off due to the if_timer not always being set
on transmit.
Finally, clean up use of hardcoded magic numbers, get them from hpcreg.h
when possible.
The Milan configuration is split up in 2 parts:
- MILAN_ISAIDE
Supports the traditionally formatted IDE disks on the Milan
- MILAN_PCIIDE
Supports the byte swapped formatted IDE disks on the Milan
If you want to read more, checkout the comment in MILAN.in...
fact it didn't work that well either), all could be done by simply adding the
NOSTREAM options to the flags of the generic ISA frontend.
There was probably to much byteswapping in my brain when I invented this.
fdexpand(). The former will return ENOSPC if there is not space
in the current filedesc table. The latter performs the expansion
of the filedesc table. This means that fdalloc() won't ever block,
and it gives callers an opportunity to clean up before the
potentially-blocking fdexpand() call.
Update all fdalloc() callers to deal with the need-to-fdexpand() case.
Rewrite unp_externalize() to use fdalloc() and fdexpand() in a
safe way, using an algorithm suggested by Bill Sommerfeld:
- Use a temporary array of integers to hold the new filedesc table
indexes. This allows us to repeat the loop if necessary.
- Loop through the array of file *'s, assigning them to filedesc table
slots. If fdalloc() indicates expansion is necessary, undo the
assignments we've done so far, expand, and retry the whole process.
- Once all file *'s have been assigned to slots, update the f_msgcount
and unp_rights counters.
- Right before we return, copy the temporary integer array to the message
buffer, and trim the length as before.
Note that once locking is added to the filedesc array, this entire
operation will be `atomic', in that the lock will be held while
file *'s are assigned to embryonic table slots, thus preventing anything
else from using them.