Skip to content

Commit

Permalink
Merge pull request #1365 from Mellvik/misc
Browse files Browse the repository at this point in the history
[serial driver] Removed hardcoding of IRQs for S2, S3
  • Loading branch information
ghaerr authored Jul 12, 2022
2 parents 8d09554 + 8e0af87 commit e59601c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions elks/arch/i86/drivers/char/serial-8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static struct serial_info ports[NR_SERIAL] = {
{(char *)COM4_PORT, COM4_IRQ, 0, DEFAULT_LCR, DEFAULT_MCR, 0, NULL, 0,0,0},
};

static char irq_to_port[16];
static unsigned int divisors[] = {
0, /* 0 = B0 */
2304, /* 1 = B50 */
Expand Down Expand Up @@ -276,15 +277,13 @@ void fast_com2_irq(void)

#if !defined(CONFIG_FAST_IRQ4) || !defined(CONFIG_FAST_IRQ3)

static int irq_port[NR_SERIAL] = { 3, 1, 0, 2 }; //FIXME must change with ports.h

/*
* Slower serial interrupt routine, called from _irq_com with passed irq #
* Reads all FIFO data available per interrupt and can provide serial stats
*/
void rs_irq(int irq, struct pt_regs *regs)
{
struct serial_info *sp = &ports[irq_port[irq - 2]];
struct serial_info *sp = &ports[(int)irq_to_port[irq]];
char *io = sp->io;
struct ch_queue *q = &sp->tty->inq;

Expand Down Expand Up @@ -441,6 +440,7 @@ static void rs_init(void)
register struct tty *tty = ttys + NR_CONSOLES;

do {
irq_to_port[sp->irq] = sp - ports; /* Map irq to tty # */
if (!rs_probe(sp)) {
switch(sp->irq) {
#ifdef CONFIG_FAST_IRQ4
Expand Down Expand Up @@ -475,7 +475,7 @@ void rs_conout(dev_t dev, char Ch)
}

#ifdef CONFIG_BOOTOPTS
/* note: this function may be called prior to serial_init if serial console set*/
/* note: this function may be called prior to serial_init if serial console set */
void INITPROC rs_setbaud(dev_t dev, unsigned long baud)
{
register struct serial_info *sp = &ports[MINOR(dev) - RS_MINOR_OFFSET];
Expand Down

0 comments on commit e59601c

Please sign in to comment.