Changeset af75db9 in mainline


Ignore:
Timestamp:
2009-02-12T20:05:15Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
912ee7c
Parents:
95b9963
Message:

remove (almost all) platform dependent code from drivers

Location:
kernel/genarch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/Makefile.inc

    r95b9963 raf75db9  
    3434                genarch/src/acpi/madt.c
    3535endif
     36
    3637ifeq ($(CONFIG_PAGE_PT),y)
    3738        GENARCH_SOURCES += \
     
    3940                genarch/src/mm/as_pt.c
    4041endif
     42
    4143ifeq ($(CONFIG_PAGE_HT),y)
    4244        GENARCH_SOURCES += \
     
    4446                genarch/src/mm/as_ht.c
    4547endif
     48
    4649ifeq ($(CONFIG_ASID),y)
    4750        GENARCH_SOURCES += \
    4851                genarch/src/mm/asid.c
    4952endif
     53
    5054ifeq ($(CONFIG_ASID_FIFO),y)
    5155        GENARCH_SOURCES += \
    5256                genarch/src/mm/asid_fifo.c
    5357endif
     58
    5459ifeq ($(CONFIG_SOFTINT),y)
    5560        GENARCH_SOURCES += \
     
    5762endif
    5863
    59 ## Framebuffer
    6064ifeq ($(CONFIG_FB),y)
    6165        GENARCH_SOURCES += \
     
    6367                genarch/src/fb/logo-196x66.c \
    6468                genarch/src/fb/fb.c
    65         DEFS += -DCONFIG_FB
    6669endif
    6770
    68 ## i8042 controller
    6971ifeq ($(CONFIG_I8042),y)
    7072        GENARCH_SOURCES += \
     
    7476endif
    7577
    76 ## Sun keyboard
    7778ifeq ($(CONFIG_SUN_KBD),y)
    7879        GENARCH_SOURCES += \
     
    8182endif
    8283
    83 ## z8530 controller
    8484ifeq ($(CONFIG_Z8530),y)
    8585        GENARCH_SOURCES += \
     
    8787endif
    8888
    89 ## ns16550 controller
    9089ifeq ($(CONFIG_NS16550),y)
    9190        GENARCH_SOURCES += \
     
    9392endif
    9493
    95 
    96 ## OpenFirmware Device Tree
    9794ifeq ($(CONFIG_OFW_TREE), y)
    9895        GENARCH_SOURCES += \
     
    105102endif
    106103
    107 ## EGA
    108104ifeq ($(CONFIG_EGA), y)
    109105        GENARCH_SOURCES += \
  • kernel/genarch/src/kbd/i8042.c

    r95b9963 raf75db9  
    3838
    3939#include <genarch/kbd/i8042.h>
    40 #ifdef ia64
    4140#include <arch/drivers/kbd.h>
    42 #endif
    4341#include <genarch/kbd/key.h>
    4442#include <genarch/kbd/scanc.h>
     
    172170        i8042_mouse_irq.handler = i8042_irq_handler;
    173171        irq_register(&i8042_mouse_irq);
    174 #ifndef ia64   
     172       
    175173        trap_virtual_enable_irqs(1 << kbd_inr);
    176174        trap_virtual_enable_irqs(1 << mouse_inr);
    177 #endif 
     175       
    178176        /*
    179177         * Clear input buffer.
     
    190188#ifdef KBD_LEGACY
    191189        sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
    192 #endif 
     190#endif
    193191        sysinfo_set_item_val("mouse", NULL, true);
    194192        sysinfo_set_item_val("mouse.devno", NULL, mouse_devno);
     
    210208char i8042_key_read(chardev_t *d)
    211209{
    212         char ch;       
    213 
    214         while(!(ch = active_read_buff_read())) {
     210        char ch;
     211       
     212        while (!(ch = active_read_buff_read())) {
    215213                uint8_t x;
    216                 while (!(i8042_status_read() & i8042_BUFFER_FULL_MASK))
    217                         ;
     214               
     215                while (!(i8042_status_read() & i8042_BUFFER_FULL_MASK));
     216               
    218217                x = i8042_data_read();
    219218                if (x & KEY_RELEASE)
     
    232231{
    233232        uint8_t x;
    234 
     233       
    235234        while (((x = i8042_status_read() & i8042_BUFFER_FULL_MASK))) {
    236235                x = i8042_data_read();
  • kernel/genarch/src/kbd/key.c

    r95b9963 raf75db9  
    4141#endif
    4242
    43 #if (defined(sparc64))
     43#if (defined(US)) || (defined(US3))
    4444#include <genarch/kbd/scanc_sun.h>
    4545#endif
  • kernel/genarch/src/kbd/ns16550.c

    r95b9963 raf75db9  
    4040#include <genarch/kbd/scanc_sun.h>
    4141#include <arch/drivers/kbd.h>
    42 #ifndef ia64
    43 #include <arch/drivers/ns16550.h>
    44 #endif
    4542#include <ddi/irq.h>
    4643#include <ipc/irq.h>
     
    131128        ns16550_irq.cir_arg = cir_arg;
    132129        irq_register(&ns16550_irq);
    133 
    134 
     130       
    135131        while ((ns16550_lsr_read(&ns16550) & LSR_DATA_READY))
    136132                ns16550_rbr_read(&ns16550);
    137 
    138133       
    139134        sysinfo_set_item_val("kbd", NULL, true);
     
    143138        sysinfo_set_item_val("kbd.address.virtual", NULL, port);
    144139        sysinfo_set_item_val("kbd.port", NULL, port);
    145 
     140       
    146141#ifdef CONFIG_NS16550_INTERRUPT_DRIVEN
    147142        /* Enable interrupts */
    148         ns16550_ier_write(&ns16550, IER_ERBFI);
     143        ns16550_ier_write(&ns16550, IER_ERBFI);
    149144        ns16550_mcr_write(&ns16550, MCR_OUT2);
    150145#endif
    151 
    152 #ifdef ia64
    153         uint8_t c;
    154         // This switches rbr & ier to mode when accept baudrate constant
    155         c = ns16550_lcr_read(&ns16550);
    156         ns16550_lcr_write(&ns16550, 0x80 | c);
    157         ns16550_rbr_write(&ns16550, 0x0c);
    158         ns16550_ier_write(&ns16550, 0x00);
    159         ns16550_lcr_write(&ns16550, c);
    160 #endif
     146       
     147        uint8_t c;
     148        // This switches rbr & ier to mode when accept baudrate constant
     149        c = ns16550_lcr_read(&ns16550);
     150        ns16550_lcr_write(&ns16550, 0x80 | c);
     151        ns16550_rbr_write(&ns16550, 0x0c);
     152        ns16550_ier_write(&ns16550, 0x00);
     153        ns16550_lcr_write(&ns16550, c);
    161154       
    162155        ns16550_grab();
     
    186179        while(!(ch = active_read_buff_read())) {
    187180                uint8_t x;
    188                 while (!(ns16550_lsr_read(&ns16550) & LSR_DATA_READY))
    189                         ;
     181                while (!(ns16550_lsr_read(&ns16550) & LSR_DATA_READY));
     182               
    190183                x = ns16550_rbr_read(&ns16550);
    191 #ifndef ia64
     184               
    192185                if (x != IGNORE_CODE) {
    193186                        if (x & KEY_RELEASE)
     
    196189                                active_read_key_pressed(x);
    197190                }
    198 #else
    199                 extern chardev_t kbrd;
    200                 if(x != 0x0d) {
    201                         if(x == 0x7f)
    202                                 x = '\b';
    203                          chardev_push_character(&kbrd, x);
    204                 }   
    205 #endif         
    206 
    207191        }
    208192        return ch;
     
    215199void ns16550_poll(void)
    216200{
    217 #ifndef CONFIG_NS16550_INTERRUPT_DRIVEN 
     201#ifndef CONFIG_NS16550_INTERRUPT_DRIVEN
    218202        ipl_t ipl;
    219203
     
    241225               
    242226                x = ns16550_rbr_read(&ns16550);
    243 #ifndef ia64
     227               
    244228                if (x != IGNORE_CODE) {
    245229                        if (x & KEY_RELEASE)
     
    248232                                key_pressed(x);
    249233                }
    250 #else
    251                 extern chardev_t kbrd;
    252                 if(x != 0x0d) {
    253                         if (x == 0x7f)
    254                                 x = '\b';
    255                         chardev_push_character(&kbrd, x);
    256                 }   
    257 #endif         
    258 
    259234        }
    260235}
Note: See TracChangeset for help on using the changeset viewer.