* Add the kernel debugger extensions only for the haiku target.
* Acknowledge non-enabled interrupts in UHCI as done in EHCI as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30063 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -66,7 +66,7 @@ PhysicalMemoryAllocator::PhysicalMemoryAllocator(const char *name,
|
||||
fManagedMemory = fBlockSize[0] * fArrayLength[0];
|
||||
|
||||
size_t roundedSize = biggestSize * minCountPerBlock;
|
||||
#if KDEBUG
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
fDebugBase = roundedSize;
|
||||
fDebugChunkSize = 64;
|
||||
fDebugUseMap = 0;
|
||||
@@ -128,7 +128,7 @@ status_t
|
||||
PhysicalMemoryAllocator::Allocate(size_t size, void **logicalAddress,
|
||||
void **physicalAddress)
|
||||
{
|
||||
#if KDEBUG
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
if (debug_debugger_running()) {
|
||||
for (int32 i = 0; i < 64; i++) {
|
||||
uint64 mask = 1LL << i;
|
||||
@@ -222,7 +222,7 @@ status_t
|
||||
PhysicalMemoryAllocator::Deallocate(size_t size, void *logicalAddress,
|
||||
void *physicalAddress)
|
||||
{
|
||||
#if KDEBUG
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
if (debug_debugger_running()) {
|
||||
uint32 index = ((uint8 *)logicalAddress - (uint8 *)fLogicalBase
|
||||
- fDebugBase) / fDebugChunkSize;
|
||||
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
size_t *fArrayOffset;
|
||||
uint8 **fArray;
|
||||
|
||||
#if KDEBUG
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
uint32 fDebugBase;
|
||||
uint32 fDebugChunkSize;
|
||||
uint64 fDebugUseMap;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
Stack *gUSBStack = NULL;
|
||||
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
static int
|
||||
debug_get_pipe_for_id(int argc, char **argv)
|
||||
{
|
||||
@@ -33,6 +34,7 @@ debug_get_pipe_for_id(int argc, char **argv)
|
||||
set_debug_variable("_usbPipe", (uint64)object);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int32
|
||||
@@ -44,7 +46,7 @@ bus_std_ops(int32 op, ...)
|
||||
if (gUSBStack)
|
||||
return B_OK;
|
||||
|
||||
#ifndef __HAIKU__
|
||||
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||
// This code is to handle plain R5 (non-BONE) where the same module
|
||||
// gets loaded multiple times (once for each exported module
|
||||
// interface, the USB v2 and v3 API in our case). We don't want to
|
||||
@@ -62,7 +64,7 @@ bus_std_ops(int32 op, ...)
|
||||
|
||||
#ifdef TRACE_USB
|
||||
set_dprintf_enabled(true);
|
||||
#ifndef __HAIKU__
|
||||
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
load_driver_symbols("usb");
|
||||
#endif
|
||||
#endif
|
||||
@@ -77,10 +79,12 @@ bus_std_ops(int32 op, ...)
|
||||
}
|
||||
|
||||
gUSBStack = stack;
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
add_debugger_command("get_usb_pipe_for_id",
|
||||
&debug_get_pipe_for_id,
|
||||
"Gets the config for a USB pipe");
|
||||
#ifndef __HAIKU__
|
||||
#elif HAIKU_TARGET_PLATFORM_BEOS
|
||||
// Plain R5 workaround, see comment above.
|
||||
shared = create_area("shared usb stack", &address,
|
||||
B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_NO_LOCK,
|
||||
@@ -95,8 +99,11 @@ bus_std_ops(int32 op, ...)
|
||||
TRACE_MODULE("uninit\n");
|
||||
delete gUSBStack;
|
||||
gUSBStack = NULL;
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
remove_debugger_command("get_usb_pipe_for_id",
|
||||
&debug_get_pipe_for_id);
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -520,7 +520,7 @@ EHCI::AddTo(Stack *stack)
|
||||
{
|
||||
#ifdef TRACE_USB
|
||||
set_dprintf_enabled(true);
|
||||
#ifndef __HAIKU__
|
||||
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
load_driver_symbols("ehci");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -511,7 +511,7 @@ OHCI::AddTo(Stack *stack)
|
||||
{
|
||||
#ifdef TRACE_USB
|
||||
set_dprintf_enabled(true);
|
||||
#ifndef __HAIKU__
|
||||
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
load_driver_symbols("ohci");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,7 @@ pci_module_info *UHCI::sPCIModule = NULL;
|
||||
static int32 sDebuggerCommandAdded = 0;
|
||||
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
static int
|
||||
debug_process_transfer(int argc, char **argv)
|
||||
{
|
||||
@@ -45,6 +46,7 @@ debug_process_transfer(int argc, char **argv)
|
||||
transfer.SetData(data, length);
|
||||
return ((UHCI *)pipe->GetBusManager())->ProcessDebugTransfer(&transfer);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int32
|
||||
@@ -494,11 +496,13 @@ UHCI::UHCI(pci_info *info, Stack *stack)
|
||||
WriteReg16(UHCI_USBINTR, UHCI_USBINTR_CRC | UHCI_USBINTR_IOC
|
||||
| UHCI_USBINTR_SHORT);
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
if (atomic_add(&sDebuggerCommandAdded, 1) == 0) {
|
||||
add_debugger_command("uhci_process_transfer",
|
||||
&debug_process_transfer,
|
||||
"Processes a USB transfer with the given variables");
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE("UHCI host controller driver constructed\n");
|
||||
fInitOK = true;
|
||||
@@ -507,10 +511,12 @@ UHCI::UHCI(pci_info *info, Stack *stack)
|
||||
|
||||
UHCI::~UHCI()
|
||||
{
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
if (atomic_add(&sDebuggerCommandAdded, -1) == 1) {
|
||||
remove_debugger_command("uhci_process_transfer",
|
||||
&debug_process_transfer);
|
||||
}
|
||||
#endif
|
||||
|
||||
int32 result = 0;
|
||||
fStopFinishThread = true;
|
||||
@@ -1674,6 +1680,11 @@ UHCI::Interrupt()
|
||||
// Check if we really had an interrupt
|
||||
uint16 status = ReadReg16(UHCI_USBSTS);
|
||||
if ((status & fEnabledInterrupts) == 0) {
|
||||
if (status != 0) {
|
||||
TRACE("discarding not enabled interrupts 0x%08lx\n", status);
|
||||
WriteReg16(UHCI_USBSTS, status);
|
||||
}
|
||||
|
||||
release_spinlock(&lock);
|
||||
return B_UNHANDLED_INTERRUPT;
|
||||
}
|
||||
@@ -1737,7 +1748,7 @@ UHCI::AddTo(Stack *stack)
|
||||
{
|
||||
#ifdef TRACE_USB
|
||||
set_dprintf_enabled(true);
|
||||
#ifndef __HAIKU__
|
||||
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
load_driver_symbols("uhci");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user