79a80
> #include "sim/emul_driver.hh"
607c608,610
< if (fd < 0 || process->sim_fd(fd) < 0) {
---
> Process::FdMap *fdObj = process->sim_fd_obj(fd);
>
> if (fdObj == NULL) {
611a615,618
> if (fdObj->driver != NULL) {
> return fdObj->driver->ioctl(process, tc, req);
> }
>
632,638d638
< if (path == "/dev/sysdev0") {
< // This is a memory-mapped high-resolution timer device on Alpha.
< // We don't support it, so just punt.
< warn("Ignoring open(%s, ...)\n", path);
< return -ENOENT;
< }
<
663a664,683
> if (startswith(path, "/dev/")) {
> std::string filename = path.substr(strlen("/dev/"));
> if (filename == "sysdev0") {
> // This is a memory-mapped high-resolution timer device on Alpha.
> // We don't support it, so just punt.
> warn("Ignoring open(%s, ...)\n", path);
> return -ENOENT;
> }
>
> EmulatedDriver *drv = process->findDriver(filename);
> if (drv != NULL) {
> // the driver's open method will allocate a fd from the
> // process if necessary.
> return drv->open(process, tc, mode, hostFlags);
> }
>
> // fall through here for pass through to host devices, such as
> // /dev/zero
> }
>