Ticket #3124: fbsd_compat.diff

File fbsd_compat.diff, 5.1 KB (added by Adek336, 16 years ago)
  • src/system/kernel/device_manager/devfs.cpp

     
    215215{
    216216    struct devfs_vnode* vnode;
    217217
     218    if (name[0] < 0)
     219        panic("devfs_create_vnode: name[0] < 0");
     220
    218221    vnode = (struct devfs_vnode*)malloc(sizeof(struct devfs_vnode));
    219222    if (vnode == NULL)
    220223        return NULL;
  • src/system/kernel/fs/vfs.cpp

     
    54705470            return B_BAD_ADDRESS;
    54715471
    54725472        ASSERT(entry->d_reclen >= sizeof(struct dirent));
     5473        ASSERT(entry->d_reclen <= sizeof(buffer));
    54735474
    54745475        if (user_memcpy(entry->d_name, userEntry->d_name,
    5475                 entry->d_reclen - sizeof(struct dirent)) != B_OK)
     5476                entry->d_reclen - sizeof(struct dirent) + 1) != B_OK)
    54765477            return B_BAD_ADDRESS;
    54775478    } else
    54785479        entry = userEntry;
  • src/libs/compat/freebsd_network/if.c

     
    101101    driver_printf("%s: /dev/%s\n", gDriverName, ifp->device_name);
    102102
    103103    gDeviceNameList[ifp->if_index] = ifp->device_name;
     104    ktrace_printf("if_initname: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    104105    gDevices[ifp->if_index] = ifp;
    105106
    106107    ifp->root_device = find_root_device(unit);
     
    309310void
    310311ether_ifattach(struct ifnet *ifp, const uint8_t *macAddress)
    311312{
     313    ktrace_printf("ether_ifattach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    312314    ifp->if_addrlen = ETHER_ADDR_LEN;
    313315    ifp->if_hdrlen = ETHER_HDR_LEN;
    314316    if_attach(ifp);
     
    324326    //      once all drivers are cleaned up.
    325327    if (macAddress != IFP2ENADDR(ifp))
    326328        memcpy(IFP2ENADDR(ifp), macAddress, ETHER_ADDR_LEN);
     329    ktrace_printf("ether_ifattach: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    327330}
    328331
    329332
  • src/libs/compat/freebsd_network/device.c

     
    3333            break;
    3434    }
    3535
     36    ktrace_printf("compat_open: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
     37
    3638    if (gDeviceNameList[i] == NULL)
    3739        return B_ERROR;
    3840
  • src/libs/compat/freebsd_network/compat/sys/haiku-module.h

     
    7474    void uninit_driver()                                                \
    7575        { _fbsd_uninit_driver(DRIVER_MODULE_NAME(name, busname)); }     \
    7676    const char **publish_devices()                                      \
    77         { return gDeviceNameList; }                                     \
     77        { ktrace_printf("publish_devices: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); return gDeviceNameList; }                                      \
    7878    device_hooks *find_device(const char *name)                         \
    7979        { return &gDeviceHooks; }
    8080
  • src/libs/compat/freebsd_network/compat.c

     
    377377    if (result == 0)
    378378        atomic_or(&device->flags, DEVICE_ATTACHED);
    379379
     380    ktrace_printf("device_attach: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
     381
    380382    return result;
    381383}
    382384
     
    404406bus_generic_attach(device_t dev)
    405407{
    406408    device_t child = NULL;
     409    ktrace_printf("bus_generic_attach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    407410
    408411    while ((child = list_get_next_item(&dev->children, child)) != NULL) {
    409412        if (child->driver == NULL) {
     
    424427                return result;
    425428        }
    426429    }
     430    ktrace_printf("bus_generic_attach: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    427431
    428432    return 0;
    429433}
     
    433437bus_generic_detach(device_t device)
    434438{
    435439    device_t child = NULL;
     440    ktrace_printf("bus_generic_detach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    436441
    437442    if ((device->flags & DEVICE_ATTACHED) == 0)
    438443        return B_ERROR;
     
    444449
    445450        device_detach(child);
    446451    }
     452    ktrace_printf("bus_generic_detach: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    447453
    448454    return 0;
    449455}
  • src/libs/compat/freebsd_network/driver.c

     
    5858        device_delete_child(NULL, root);
    5959        return B_NO_MEMORY;
    6060    }
     61    ktrace_printf("init_root_device: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    6162
    6263    root->driver = &sRootDriver;
    6364    root->root = root;
     
    125126            break;
    126127        }
    127128    }
     129    ktrace_printf("_fbsd_init_hardware: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    128130
    129131    if (status < B_OK)
    130132        TRACE(("%s: no hardware found.\n", gDriverName));
     
    181183
    182184            if (device_attach(device) == 0)
    183185                found = true;
     186            ktrace_printf("_fbsd_init_driver: gDeviceNameList[0]=%s\n", gDeviceNameList[0]);
    184187
    185188            i++;
    186189            break;