Subversion Repositories HelenOS

Rev

Rev 3961 | Rev 4042 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3961 Rev 3982
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (c) 2001-2004 Jakub Jermar
2
 * Copyright (c) 2009 Jakub Jermar
3
 * All rights reserved.
3
 * All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
7
 * are met:
7
 * are met:
Line 39... Line 39...
39
#include <genarch/kbd/scanc.h>
39
#include <genarch/kbd/scanc.h>
40
#include <genarch/kbd/scanc_sun.h>
40
#include <genarch/kbd/scanc_sun.h>
41
#include <arch/drivers/kbd.h>
41
#include <arch/drivers/kbd.h>
42
#include <console/console.h>
42
#include <console/console.h>
43
#include <console/chardev.h>
43
#include <console/chardev.h>
44
#include <sysinfo/sysinfo.h>
-
 
45
#include <ddi/irq.h>
44
#include <ddi/irq.h>
46
#include <arch/asm.h>
45
#include <arch/asm.h>
47
#include <mm/slab.h>
46
#include <mm/slab.h>
48
 
47
 
49
static inline void z8530_write(ioport8_t *ctl, uint8_t reg, uint8_t val)
48
static inline void z8530_write(ioport8_t *ctl, uint8_t reg, uint8_t val)
Line 120... Line 119...
120
    z8530_write(&dev->ctl_a, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE);
119
    z8530_write(&dev->ctl_a, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE);
121
   
120
   
122
    /* Master Interrupt Enable. */
121
    /* Master Interrupt Enable. */
123
    z8530_write(&dev->ctl_a, WR9, WR9_MIE);
122
    z8530_write(&dev->ctl_a, WR9, WR9_MIE);
124
 
123
 
125
    /*
-
 
126
     * This is the necessary evil until the userspace drivers are entirely
-
 
127
     * self-sufficient.
-
 
128
     */
-
 
129
    sysinfo_set_item_val("kbd", NULL, true);
-
 
130
    sysinfo_set_item_val("kbd.type", NULL, KBD_Z8530);
-
 
131
    sysinfo_set_item_val("kbd.devno", NULL, devno);
-
 
132
    sysinfo_set_item_val("kbd.inr", NULL, inr);
-
 
133
    sysinfo_set_item_val("kbd.address.virtual", NULL, (uintptr_t) dev);
-
 
134
 
-
 
135
    return true;
124
    return true;
136
}
125
}
137
 
126
 
138
/* Called from getc(). */
127
/* Called from getc(). */
139
void z8530_resume(chardev_t *d)
128
void z8530_resume(chardev_t *d)