- Added AHCI port tracing (Only PRD table tracing for now).
- Added controller attribute to the AHCIPort class for debugging purposes. AHCI is failing whenever the PRD table has an address above the 2048 Mb mark. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25291 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#define TEAM_TRACING 0
|
||||
#define USER_MALLOC_TRACING 0
|
||||
#define WAIT_FOR_OBJECTS_TRACING 0
|
||||
#define AHCI_PORT_TRACING 0
|
||||
|
||||
#endif // ENABLE_TRACING
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <new>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <tracing.h>
|
||||
|
||||
#define TRACE(a...) dprintf("\33[34mahci:\33[0m " a)
|
||||
//#define FLOW(a...) dprintf("ahci: " a)
|
||||
@@ -22,9 +23,66 @@
|
||||
#define FLOW(a...)
|
||||
#define RWTRACE(a...)
|
||||
|
||||
#if AHCI_PORT_TRACING
|
||||
|
||||
namespace AHCIPortTracing {
|
||||
|
||||
class AHCIPortTraceEntry : public AbstractTraceEntry {
|
||||
protected:
|
||||
AHCIPortTraceEntry(AHCIController* controller, int index)
|
||||
: fController(controller)
|
||||
, fIndex(index)
|
||||
{
|
||||
}
|
||||
|
||||
void AddDump(TraceOutput& out, const char* name)
|
||||
{
|
||||
out.Print(name);
|
||||
out.Print("controller: %p", fController);
|
||||
out.Print(", index: %d", fIndex);
|
||||
}
|
||||
|
||||
AHCIController* fController;
|
||||
int fIndex;
|
||||
};
|
||||
|
||||
|
||||
class AHCIPortPrdTable : public AHCIPortTraceEntry {
|
||||
public:
|
||||
AHCIPortPrdTable(AHCIController* controller, int index, void* address,
|
||||
size_t size)
|
||||
: AHCIPortTraceEntry(controller, index)
|
||||
, fAddress(address)
|
||||
, fSize(size)
|
||||
{
|
||||
Initialized();
|
||||
}
|
||||
|
||||
void AddDump(TraceOutput& out)
|
||||
{
|
||||
AHCIPortTraceEntry::AddDump(out, " - prd table: ");
|
||||
|
||||
out.Print("address: %p", fAddress);
|
||||
out.Print(", size: %lu", fSize);
|
||||
}
|
||||
|
||||
void* fAddress;
|
||||
int fSize;
|
||||
};
|
||||
|
||||
|
||||
} // namespace AHCIPortTracing
|
||||
|
||||
# define T(x) new(std::nothrow) AHCIPortTracing::x
|
||||
|
||||
#else
|
||||
# define T(x)
|
||||
#endif // AHCI_PORT_TRACING
|
||||
|
||||
|
||||
AHCIPort::AHCIPort(AHCIController *controller, int index)
|
||||
: fIndex(index)
|
||||
: fController(controller)
|
||||
, fIndex(index)
|
||||
, fRegs(&controller->fRegs->port[index])
|
||||
, fArea(-1)
|
||||
, fSpinlock(0)
|
||||
@@ -322,6 +380,7 @@ AHCIPort::FillPrdTable(volatile prd *prdTable, int *prdCount, int prdMax, const
|
||||
while (sgCount > 0 && dataSize > 0) {
|
||||
size_t size = min_c(sgTable->size, dataSize);
|
||||
void *address = sgTable->address;
|
||||
T(AHCIPortPrdTable(fController, fIndex, address, size));
|
||||
FLOW("FillPrdTable: sg-entry addr %p, size %lu\n", address, size);
|
||||
if ((uint32)address & 1) {
|
||||
TRACE("AHCIPort::FillPrdTable: data alignment error\n");
|
||||
|
||||
@@ -52,6 +52,7 @@ private:
|
||||
status_t FillPrdTable(volatile prd *prdTable, int *prdCount, int prdMax, const physical_entry *sgTable, int sgCount, size_t dataSize);
|
||||
|
||||
private:
|
||||
AHCIController* fController;
|
||||
int fIndex;
|
||||
volatile ahci_port * fRegs;
|
||||
area_id fArea;
|
||||
|
||||
Reference in New Issue
Block a user