Ticket #5754: pc_serial.diff

File pc_serial.diff, 2.8 KB (added by andreasf, 13 years ago)

proposed patch

  • src/add-ons/kernel/drivers/ports/pc_serial/Driver.cpp

    diff -r a3d77690e0f3 src/add-ons/kernel/drivers/ports/pc_serial/Driver.cpp
    a b  
    2626config_manager_for_driver_module_info *gConfigManagerModule = NULL;
    2727isa_module_info *gISAModule = NULL;
    2828pci_module_info *gPCIModule = NULL;
    29 //XXX: ifndef __HAIKU__
     29#ifdef __HAIKU__
     30tty_module_info *gTTYModule = NULL;
     31#else
    3032tty_module_info_v1_bone *gTTYModule = NULL;
     33#endif
    3134struct ddomain gSerialDomain;
    3235sem_id gDriverLock = -1;
    3336bool gHandleISA = false;
     
    730733    status = ENOENT;
    731734
    732735    memset(&gSerialDomain, 0, sizeof(gSerialDomain));
     736#ifndef __HAIKU__
    733737    ddbackground(&gSerialDomain);
     738#endif
    734739
    735740
    736741    scan_bus(B_ISA_BUS);
  • src/add-ons/kernel/drivers/ports/pc_serial/Driver.h

    diff -r a3d77690e0f3 src/add-ons/kernel/drivers/ports/pc_serial/Driver.h
    a b  
    191191extern config_manager_for_driver_module_info *gConfigManagerModule;
    192192extern isa_module_info *gISAModule;
    193193extern pci_module_info *gPCIModule;
    194 //extern tty_module_info *gTTYModule;
     194#ifdef __HAIKU__
     195extern tty_module_info *gTTYModule;
     196#else
    195197extern tty_module_info_v1_bone *gTTYModule;
     198#endif
    196199extern struct ddomain gSerialDomain;
    197200
    198201extern "C" {
     
    202205bool        pc_serial_service(struct tty *ptty, struct ddrover *ddr, uint flags);
    203206int32       pc_serial_interrupt(void *arg);
    204207
    205 status_t    pc_serial_open(const char *name, uint32 flags, void **cookie);
    206 status_t    pc_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes);
    207 status_t    pc_serial_write(void *cookie, off_t position, const void *buffer, size_t *numBytes);
    208 status_t    pc_serial_control(void *cookie, uint32 op, void *arg, size_t length);
    209 status_t    pc_serial_select(void *cookie, uint8 event, uint32 ref, selectsync *sync);
    210 status_t    pc_serial_deselect(void *coookie, uint8 event, selectsync *sync);
    211 status_t    pc_serial_close(void *cookie);
    212 status_t    pc_serial_free(void *cookie);
     208static status_t pc_serial_open(const char *name, uint32 flags, void **cookie);
     209static status_t pc_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes);
     210static status_t pc_serial_write(void *cookie, off_t position, const void *buffer, size_t *numBytes);
     211static status_t pc_serial_control(void *cookie, uint32 op, void *arg, size_t length);
     212static status_t pc_serial_select(void *cookie, uint8 event, uint32 ref, selectsync *sync);
     213static status_t pc_serial_deselect(void *coookie, uint8 event, selectsync *sync);
     214static status_t pc_serial_close(void *cookie);
     215static status_t pc_serial_free(void *cookie);
    213216
    214217const char **publish_devices();
    215218device_hooks *find_device(const char *name);