From: theStack Date: Mon, 21 Sep 2009 02:19:04 +0000 (+0200) Subject: ed is static now, and it works! \o/ X-Git-Tag: demo0~25 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=ppcskel.git;a=commitdiff_plain;h=fcf79bc1bc34cfc6709870e24efc35766587febd ed is static now, and it works! \o/ --- diff --git a/usb/host/ohci.c b/usb/host/ohci.c index e8c7db4..79283ae 100644 --- a/usb/host/ohci.c +++ b/usb/host/ohci.c @@ -228,6 +228,7 @@ static void dump_address(void *addr, u32 size, const char* str) hexdump(addr, size); } +static struct endpoint_descriptor _edhead; struct endpoint_descriptor *edhead = 0; void hcdi_fire() { @@ -305,7 +306,6 @@ void hcdi_fire() write32(OHCI0_HC_CONTROL, read32(OHCI0_HC_CONTROL)&~OHCI_CTRL_CLE); - free(edhead); edhead = 0; printf("<^> <^> <^> hcdi_fire(end)\n"); @@ -317,7 +317,8 @@ void hcdi_fire() u8 hcdi_enqueue(const usb_transfer_descriptor *td) { printf("*()*()*()*()*()*()*() hcdi_enqueue(start)\n"); if(!edhead) { - edhead = allocate_endpoint(); + edhead = &_edhead; + memset(edhead, 0, sizeof(struct endpoint_descriptor)); edhead->flags = LE(OHCI_ENDPOINT_GENERAL_FORMAT); edhead->headp = edhead->tailp = edhead->nexted = LE(0); edhead->flags |= LE(OHCI_ENDPOINT_LOW_SPEED | @@ -368,16 +369,6 @@ void hcdi_init() /* disable hc interrupts */ set32(OHCI0_HC_INT_DISABLE, OHCI_INTR_MIE); -#if 1 - /* after a warm start we have some really odd memory issues. - * some malloc/free/sync/mmu fail?! no idea! - */ - if((read32(OHCI0_HC_CONTROL) & OHCI_CTRL_HCFS) != OHCI_USB_RESET) { - (void) malloc(256); - printf("WTF malloc\n"); - } -#endif - /* save fmInterval and calculate FSMPS */ #define FSMP(fi) (0x7fff & ((6 * ((fi) - 210)) / 7)) #define FI 0x2edf /* 12000 bits per frame (-1) */