added 1 changeset to branch 'refs/remotes/xyzzy-github/x86_64' old head: c0d28c01990d8815dddc645177f44b9ce361d186 new head: ef67788fba5d738eeb99768caea7b0e5170893f5 ---------------------------------------------------------------------------- ef67788: Ported ISA bus manager and PS/2 driver. [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Commit: ef67788fba5d738eeb99768caea7b0e5170893f5 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Mon Jul 30 13:37:28 2012 UTC ---------------------------------------------------------------------------- 7 files changed, 43 insertions(+), 31 deletions(-) build/jam/Haiku64Image | 3 +- headers/os/drivers/ISA.h | 6 ++-- src/add-ons/kernel/bus_managers/isa/Jamfile | 3 +- src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp | 14 +++++---- src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp | 24 +++++++++------- .../kernel/bus_managers/ps2/ps2_keyboard.cpp | 21 ++++++++------ .../kernel/bus_managers/ps2/ps2_service.cpp | 3 +- ---------------------------------------------------------------------------- diff --git a/build/jam/Haiku64Image b/build/jam/Haiku64Image index 18bb09c..bc7bc4a 100644 --- a/build/jam/Haiku64Image +++ b/build/jam/Haiku64Image @@ -40,7 +40,7 @@ PRIVATE_SYSTEM_LIBS = ; SYSTEM_SERVERS = ; -SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci scsi config_manager ; +SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci ps2 isa scsi config_manager ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ; # modules @@ -69,6 +69,7 @@ AddNewDriversToHaikuImage disk scsi : scsi_cd scsi_disk ; # legacy drivers AddDriversToHaikuImage : console dprintf null random <driver>tty zero ; +AddDriversToHaikuImage input : ps2_hid ; # kernel AddFilesToHaikuImage system : kernel_$(TARGET_ARCH) ; diff --git a/headers/os/drivers/ISA.h b/headers/os/drivers/ISA.h index 812e04b..2b0f5df 100644 --- a/headers/os/drivers/ISA.h +++ b/headers/os/drivers/ISA.h @@ -57,7 +57,7 @@ typedef struct isa_module_info { isa_dma_entry *table, /* -> caller-supplied scatter/gather table */ long num_entries /* max # entries in table */ ); - long (*start_isa_dma) ( + status_t (*start_isa_dma) ( long channel, /* dma channel to use */ void *buf, /* buffer to transfer */ long transfer_count, /* # transfers */ @@ -70,8 +70,8 @@ typedef struct isa_module_info { uchar mode, /* mode flags */ uchar emode /* extended mode flags */ ); - long (*lock_isa_dma_channel) (long channel); - long (*unlock_isa_dma_channel) (long channel); + status_t (*lock_isa_dma_channel) (long channel); + status_t (*unlock_isa_dma_channel) (long channel); } isa_module_info; #define B_ISA_MODULE_NAME "bus_managers/isa/v1" diff --git a/src/add-ons/kernel/bus_managers/isa/Jamfile b/src/add-ons/kernel/bus_managers/isa/Jamfile index 84a540a..77719db 100644 --- a/src/add-ons/kernel/bus_managers/isa/Jamfile +++ b/src/add-ons/kernel/bus_managers/isa/Jamfile @@ -7,4 +7,5 @@ KernelAddon isa : : isa_arch_bus_manager.a ; -SubInclude HAIKU_TOP src add-ons kernel bus_managers isa arch $(TARGET_ARCH) ; +SubInclude HAIKU_TOP src add-ons kernel bus_managers isa arch + $(TARGET_KERNEL_ARCH) ; diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp index 889c657..37f902e 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp @@ -117,7 +117,8 @@ ps2_selftest() uint8 in; res = ps2_command(PS2_CTRL_SELF_TEST, NULL, 0, &in, 1); if (res != B_OK || in != 0x55) { - INFO("ps2: controller self test failed, status 0x%08lx, data 0x%02x\n", res, in); + INFO("ps2: controller self test failed, status 0x%08" B_PRIx32 ", data " + "0x%02x\n", res, in); return B_ERROR; } return B_OK; @@ -131,7 +132,8 @@ ps2_setup_command_byte(bool interruptsEnabled) uint8 cmdbyte; res = ps2_command(PS2_CTRL_READ_CMD, NULL, 0, &cmdbyte, 1); - TRACE("ps2: get command byte: res 0x%08lx, cmdbyte 0x%02x\n", res, cmdbyte); + TRACE("ps2: get command byte: res 0x%08" B_PRIx32 ", cmdbyte 0x%02x\n", + res, cmdbyte); if (res != B_OK) cmdbyte = 0x47; @@ -144,7 +146,8 @@ ps2_setup_command_byte(bool interruptsEnabled) cmdbyte &= ~(PS2_BITS_KEYBOARD_INTERRUPT | PS2_BITS_AUX_INTERRUPT); res = ps2_command(PS2_CTRL_WRITE_CMD, &cmdbyte, 1, NULL, 0); - TRACE("ps2: set command byte: res 0x%08lx, cmdbyte 0x%02x\n", res, cmdbyte); + TRACE("ps2: set command byte: res 0x%08" B_PRIx32 ", cmdbyte 0x%02x\n", + res, cmdbyte); return res; } @@ -205,7 +208,8 @@ done: // This fixes bug report #1175 res = ps2_command(0xae, NULL, 0, NULL, 0); if (res != B_OK) { - INFO("ps2: active multiplexing d3 workaround failed, status 0x%08lx\n", res); + INFO("ps2: active multiplexing d3 workaround failed, status 0x%08" + B_PRIx32 "\n", res); } return B_OK; @@ -256,7 +260,7 @@ ps2_command(uint8 cmd, const uint8 *out, int outCount, uint8 *in, int inCount) #ifdef TRACE_PS2 for (i = 0; i < inCount; i++) TRACE("ps2: ps2_command in 0x%02x\n", in[i]); - TRACE("ps2: ps2_command result 0x%08lx\n", res); + TRACE("ps2: ps2_command result 0x%08" B_PRIx32 "\n", res); #endif atomic_add(&sIgnoreInterrupts, -1); diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp index e136301..0cb799a 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp @@ -203,8 +203,8 @@ ps2_dev_publish(ps2_dev *dev) } snooze(timeout / 20); } - TRACE("ps2: publishing %s: parent %s is %s; wait time %Ld\n", - dev->name, dev->parent_dev->name, + TRACE("ps2: publishing %s: parent %s is %s; wait time %" B_PRId64 + "\n", dev->name, dev->parent_dev->name, status == B_OK ? "enabled" : "busy", system_time() - start); } @@ -219,7 +219,8 @@ ps2_dev_publish(ps2_dev *dev) dev->active = true; - INFO("ps2: devfs_publish_device %s, status = 0x%08lx\n", dev->name, status); + INFO("ps2: devfs_publish_device %s, status = 0x%08" B_PRIx32 "\n", + dev->name, status); } @@ -239,8 +240,8 @@ ps2_dev_unpublish(ps2_dev *dev) if ((dev->flags & PS2_FLAG_ENABLED) && dev->disconnect) dev->disconnect(dev); - INFO("ps2: devfs_unpublish_device %s, status = 0x%08lx\n", dev->name, - status); + INFO("ps2: devfs_unpublish_device %s, status = 0x%08" B_PRIx32 "\n", + dev->name, status); } @@ -370,7 +371,8 @@ standard_command_timeout(ps2_dev *dev, uint8 cmd, const uint8 *out, res = get_sem_count(dev->result_sem, &sem_count); if (res == B_OK && sem_count != 0) { - TRACE("ps2: ps2_dev_command: sem_count %ld, fixing!\n", sem_count); + TRACE("ps2: ps2_dev_command: sem_count %" B_PRId32 ", fixing!\n", + sem_count); if (sem_count > 0) acquire_sem_etc(dev->result_sem, sem_count, 0, 0); else @@ -423,8 +425,8 @@ standard_command_timeout(ps2_dev *dev, uint8 cmd, const uint8 *out, if (res != B_OK) atomic_and(&dev->flags, ~PS2_FLAG_CMD); - TRACE("ps2: ps2_dev_command wait for ack res 0x%08lx, wait-time %Ld\n", - res, system_time() - start); + TRACE("ps2: ps2_dev_command wait for ack res 0x%08" B_PRIx32 ", " + "wait-time %" B_PRId64 "\n", res, system_time() - start); if (atomic_get(&dev->flags) & PS2_FLAG_ACK) { TRACE("ps2: ps2_dev_command got ACK\n"); @@ -458,15 +460,15 @@ standard_command_timeout(ps2_dev *dev, uint8 cmd, const uint8 *out, res = B_IO_ERROR; } - TRACE("ps2: ps2_dev_command wait for input res 0x%08lx, " - "wait-time %Ld\n", res, system_time() - start); + TRACE("ps2: ps2_dev_command wait for input res 0x%08" B_PRIx32 ", " + "wait-time %" B_PRId64 "\n", res, system_time() - start); for (i = 0; i < in_count; i++) TRACE("ps2: ps2_dev_command rx: 0x%02x\n", in[i]); } } - TRACE("ps2: ps2_dev_command result 0x%08lx\n", res); + TRACE("ps2: ps2_dev_command result 0x%08" B_PRIx32 "\n", res); return res; } diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp index ec6fa42..06a6049 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp @@ -88,7 +88,8 @@ set_typematic(int32 rate, bigtime_t delay) { uint8 value; - TRACE("ps2: set_typematic rate %ld, delay %Ld\n", rate, delay); + TRACE("ps2: set_typematic rate %" B_PRId32 ", delay %" B_PRId64 "\n", + rate, delay); // input server and keyboard preferences *seem* to use a range of 20-300 if (rate < 20) @@ -271,8 +272,8 @@ probe_keyboard(void) status = ps2_dev_command(&ps2_device[PS2_DEVICE_KEYB], PS2_CMD_RESET, NULL, 0, &data, 1); if (status != B_OK || data != 0xaa) { - INFO("ps2: keyboard reset failed, status 0x%08lx, data 0x%02x\n", - status, data); + INFO("ps2: keyboard reset failed, status 0x%08" B_PRIx32 ", data 0x%02x" + "\n", status, data); return B_ERROR; } @@ -297,14 +298,15 @@ probe_keyboard(void) status = ps2_command(PS2_CTRL_READ_CMD, NULL, 0, &cmdbyte, 1); if (status != B_OK) { - INFO("ps2: cannot read CMD byte on kbd probe:0x%#08lx\n", status); + INFO("ps2: cannot read CMD byte on kbd probe:%#08" B_PRIx32 "\n", + status); } else if ((cmdbyte & PS2_BITS_KEYBOARD_DISABLED) == PS2_BITS_KEYBOARD_DISABLED) { cmdbyte &= ~PS2_BITS_KEYBOARD_DISABLED; status = ps2_command(PS2_CTRL_WRITE_CMD, &cmdbyte, 1, NULL, 0); if (status != B_OK) { - INFO("ps2: cannot write 0x%02x to CMD byte on kbd probe:0x%08lx\n", - cmdbyte, status); + INFO("ps2: cannot write 0x%02x to CMD byte on kbd probe:%#08" + B_PRIx32 "\n", cmdbyte, status); } } @@ -312,7 +314,7 @@ probe_keyboard(void) PS2_CMD_GET_DEVICE_ID, NULL, 0, sKeyboardIds, sizeof(sKeyboardIds)); if (status != B_OK) { - INFO("ps2: cannot read keyboard device id:0x%#08lx\n", status); + INFO("ps2: cannot read keyboard device id:%#08" B_PRIx32 "\n", status); } return B_OK; @@ -529,7 +531,8 @@ keyboard_ioctl(void *_cookie, uint32 op, void *buffer, size_t length) case KB_SET_CONTROL_ALT_DEL_TIMEOUT: case KB_CANCEL_CONTROL_ALT_DEL: case KB_DELAY_CONTROL_ALT_DEL: - INFO("ps2: ioctl 0x%lx not implemented yet, returning B_OK\n", op); + INFO("ps2: ioctl 0x%" B_PRIx32 " not implemented yet, returning " + "B_OK\n", op); return B_OK; case KB_SET_DEBUG_READER: @@ -541,7 +544,7 @@ keyboard_ioctl(void *_cookie, uint32 op, void *buffer, size_t length) return B_OK; default: - INFO("ps2: invalid ioctl 0x%lx\n", op); + INFO("ps2: invalid ioctl 0x%" B_PRIx32 "\n", op); return B_DEV_INVALID_IOCTL; } } diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_service.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_service.cpp index 10bee95..162c121 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_service.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_service.cpp @@ -128,7 +128,8 @@ ps2_service_thread(void *arg) break; } } else { - INFO("ps2: ps2_service_thread: Error, status 0x%08lx, terminating\n", status); + INFO("ps2: ps2_service_thread: Error, status 0x%08" B_PRIx32 ", " + "terminating\n", status); break; } }