Return of the hand-optimized assembly for SGPIO read and write interrupt.

Reset only the one SGPIO slice flag that is actually causing the interrupt.
This commit is contained in:
Jared Boone
2012-10-16 16:57:35 -07:00
parent 1391bfc61e
commit 6cd8da6930

View File

@ -332,27 +332,55 @@ bool usb_set_configuration(
}; };
void sgpio_irqhandler() { void sgpio_irqhandler() {
SGPIO_CLR_STATUS_1 = 0xFFFFFFFF; SGPIO_CLR_STATUS_1 = (1 << SGPIO_SLICE_A);
uint32_t* const p = (uint32_t*)&usb_bulk_buffer[usb_bulk_buffer_offset]; uint32_t* const p = (uint32_t*)&usb_bulk_buffer[usb_bulk_buffer_offset];
if( transceiver_mode == TRANSCEIVER_MODE_RX ) { if( transceiver_mode == TRANSCEIVER_MODE_RX ) {
p[7] = SGPIO_REG_SS(SGPIO_SLICE_A); __asm__(
p[6] = SGPIO_REG_SS(SGPIO_SLICE_I); "ldr r0, [%[SGPIO_REG_SS], #44]\n\t"
p[5] = SGPIO_REG_SS(SGPIO_SLICE_E); "str r0, [%[p], #0]\n\t"
p[4] = SGPIO_REG_SS(SGPIO_SLICE_J); "ldr r0, [%[SGPIO_REG_SS], #20]\n\t"
p[3] = SGPIO_REG_SS(SGPIO_SLICE_C); "str r0, [%[p], #4]\n\t"
p[2] = SGPIO_REG_SS(SGPIO_SLICE_K); "ldr r0, [%[SGPIO_REG_SS], #40]\n\t"
p[1] = SGPIO_REG_SS(SGPIO_SLICE_F); "str r0, [%[p], #8]\n\t"
p[0] = SGPIO_REG_SS(SGPIO_SLICE_L); "ldr r0, [%[SGPIO_REG_SS], #8]\n\t"
"str r0, [%[p], #12]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #36]\n\t"
"str r0, [%[p], #16]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #16]\n\t"
"str r0, [%[p], #20]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #32]\n\t"
"str r0, [%[p], #24]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #0]\n\t"
"str r0, [%[p], #28]\n\t"
:
: [SGPIO_REG_SS] "l" (SGPIO_PORT_BASE + 0x100),
[p] "l" (p)
: "r0"
);
} else { } else {
SGPIO_REG_SS(SGPIO_SLICE_A) = p[7]; __asm__(
SGPIO_REG_SS(SGPIO_SLICE_I) = p[6]; "ldr r0, [%[p], #0]\n\t"
SGPIO_REG_SS(SGPIO_SLICE_E) = p[5]; "str r0, [%[SGPIO_REG_SS], #44]\n\t"
SGPIO_REG_SS(SGPIO_SLICE_J) = p[4]; "ldr r0, [%[p], #4]\n\t"
SGPIO_REG_SS(SGPIO_SLICE_C) = p[3]; "str r0, [%[SGPIO_REG_SS], #20]\n\t"
SGPIO_REG_SS(SGPIO_SLICE_K) = p[2]; "ldr r0, [%[p], #8]\n\t"
SGPIO_REG_SS(SGPIO_SLICE_F) = p[1]; "str r0, [%[SGPIO_REG_SS], #40]\n\t"
SGPIO_REG_SS(SGPIO_SLICE_L) = p[0]; "ldr r0, [%[p], #12]\n\t"
"str r0, [%[SGPIO_REG_SS], #8]\n\t"
"ldr r0, [%[p], #16]\n\t"
"str r0, [%[SGPIO_REG_SS], #36]\n\t"
"ldr r0, [%[p], #20]\n\t"
"str r0, [%[SGPIO_REG_SS], #16]\n\t"
"ldr r0, [%[p], #24]\n\t"
"str r0, [%[SGPIO_REG_SS], #32]\n\t"
"ldr r0, [%[p], #28]\n\t"
"str r0, [%[SGPIO_REG_SS], #0]\n\t"
:
: [SGPIO_REG_SS] "l" (SGPIO_PORT_BASE + 0x100),
[p] "l" (p)
: "r0"
);
} }
usb_bulk_buffer_offset = (usb_bulk_buffer_offset + 32) & usb_bulk_buffer_mask; usb_bulk_buffer_offset = (usb_bulk_buffer_offset + 32) & usb_bulk_buffer_mask;