Changeset 413225d in mainline for uspace/drv/audio/sb16/sb16.c
- Timestamp:
- 2011-11-30T21:25:05Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ed3f8d5
- Parents:
- 427069d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/sb16.c
r427069d r413225d 44 44 45 45 /* ISA interrupts should be edge-triggered so there should be no need for 46 * irq code magic */ 47 static const irq_cmd_t irq_cmds[] = {{ .cmd = CMD_ACCEPT }}; 48 static const irq_code_t irq_code = 49 { .cmdcount = 1, .cmds = (irq_cmd_t*)irq_cmds }; // FIXME: Remove cast 46 * irq code magic, but we still need to ack those interrupts ASAP. */ 47 static const irq_cmd_t irq_cmds[] = { 48 { .cmd = CMD_PIO_READ_8, .dstarg = 1 }, /* Address patched at runtime */ 49 { .cmd = CMD_PIO_READ_8, .dstarg = 1 }, /* Address patched at runtime */ 50 { .cmd = CMD_ACCEPT }, 51 }; 50 52 51 53 static inline sb_mixer_type_t sb_mixer_type_by_dsp_version( … … 62 64 } 63 65 /*----------------------------------------------------------------------------*/ 64 irq_code_t * sb16_irq_code(void)66 size_t sb16_irq_code_size(void) 65 67 { 66 // FIXME: Remove this cast 67 return (irq_code_t*)&irq_code; 68 return sizeof(irq_cmds) / sizeof(irq_cmds[0]); 69 } 70 /*----------------------------------------------------------------------------*/ 71 void sb16_irq_code(void *regs, int dma8, int dma16, irq_cmd_t cmds[]) 72 { 73 assert(regs); 74 assert(dma8 > 0 && dma8 < 4); 75 sb16_regs_t *registers = regs; 76 memcpy(cmds, irq_cmds, sizeof(irq_cmds)); 77 cmds[0].addr = (void*)®isters->dsp_read_status; 78 if (dma16 > 4 && dma16 < 8) { 79 /* Valid dma16 */ 80 cmds[1].addr = (void*)®isters->dma16_ack; 81 } else { 82 cmds[1].cmd = CMD_ACCEPT; 83 } 68 84 } 69 85 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.