Changeset 9cd98796 in mainline for uspace/srv/fb/ega.c


Ignore:
Timestamp:
2009-03-03T22:57:26Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ff685c9
Parents:
1ae8f2b
Message:

Use PIO in uspace EGA driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/ega.c

    r1ae8f2b r9cd98796  
    5252#include <console/style.h>
    5353#include <console/color.h>
     54#include <sys/types.h>
    5455
    5556#include "ega.h"
     
    6465saved_screen saved_screens[MAX_SAVED_SCREENS];
    6566
    66 #define EGA_IO_ADDRESS 0x3d4
     67#define EGA_IO_BASE ((ioport8_t *) 0x3d4)
    6768#define EGA_IO_SIZE 2
    6869
     
    100101        ega_cursor = col + scr_width * row;
    101102       
    102         outb(EGA_IO_ADDRESS, 0xe);
    103         outb(EGA_IO_ADDRESS + 1, (ega_cursor >> 8) & 0xff);
    104         outb(EGA_IO_ADDRESS, 0xf);
    105         outb(EGA_IO_ADDRESS + 1, ega_cursor & 0xff);
     103        pio_write_8(EGA_IO_BASE, 0xe);
     104        pio_write_8(EGA_IO_BASE + 1, (ega_cursor >> 8) & 0xff);
     105        pio_write_8(EGA_IO_BASE, 0xf);
     106        pio_write_8(EGA_IO_BASE + 1, ega_cursor & 0xff);
    106107}
    107108
     
    110111        uint8_t stat;
    111112
    112         outb(EGA_IO_ADDRESS, 0xa);
    113         stat=inb(EGA_IO_ADDRESS + 1);
    114         outb(EGA_IO_ADDRESS, 0xa);
    115         outb(EGA_IO_ADDRESS + 1, stat | (1 << 5));
     113        pio_write_8(EGA_IO_BASE, 0xa);
     114        stat = pio_read_8(EGA_IO_BASE + 1);
     115        pio_write_8(EGA_IO_BASE, 0xa);
     116        pio_write_8(EGA_IO_BASE + 1, stat | (1 << 5));
    116117}
    117118
     
    120121        uint8_t stat;
    121122
    122         outb(EGA_IO_ADDRESS, 0xa);
    123         stat=inb(EGA_IO_ADDRESS + 1);
    124         outb(EGA_IO_ADDRESS, 0xa);
    125         outb(EGA_IO_ADDRESS + 1, stat & (~(1 << 5)));
     123        pio_write_8(EGA_IO_BASE, 0xa);
     124        stat = pio_read_8(EGA_IO_BASE + 1);
     125        pio_write_8(EGA_IO_BASE, 0xa);
     126        pio_write_8(EGA_IO_BASE + 1, stat & (~(1 << 5)));
    126127}
    127128
     
    381382        style = NORMAL_COLOR;
    382383
    383         iospace_enable(task_get_id(), (void *) EGA_IO_ADDRESS, 2);
     384        iospace_enable(task_get_id(), (void *) EGA_IO_BASE, 2);
    384385
    385386        sz = scr_width * scr_height * 2;
Note: See TracChangeset for help on using the changeset viewer.