source: soft/giet_vm/giet_drivers/tty_driver.h @ 469

Last change on this file since 469 was 469, checked in by alain, 10 years ago

The global variables associated to TTY channels are not anymore
defined in the tty_driver.c file, but in the boot.c and kernel_init.c files.

File size: 3.1 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : tty_driver.h
3// Date     : 01/11/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7// The tty_driver.c and tty_drivers.h files are part ot the GIET-VM kernel.
8// This driver supports the SocLib vci_multi_tty component.
9//
10// The total number of TTY terminals must be defined by the configuration
11// parameter NB_TTY_CHANNELS in the hard_config.h file.
12//
13// The "system" terminal is TTY[0].
14// The "user" TTYs are allocated to applications requesting it.
15//
16// The SEG_TTY_BASE address must be defined in the hard_config.h file.
17//
18// All physical accesses to device registers are done by the two
19// _tty_get_register(), _tty_set_register() low-level functions,
20// that are handling virtual / physical addressing.
21///////////////////////////////////////////////////////////////////////////////////
22
23#ifndef _GIET_TTY_DRIVERS_H_
24#define _GIET_TTY_DRIVERS_H_
25
26#include "hard_config.h"
27#include "locks.h"
28
29///////////////////////////////////////////////////////////////////////////////////
30//                     registers offsets
31///////////////////////////////////////////////////////////////////////////////////
32
33enum TTY_registers
34{
35    TTY_WRITE   = 0,
36    TTY_STATUS  = 1,
37    TTY_READ    = 2,
38    TTY_CONFIG  = 3,
39    /**/
40    TTY_SPAN    = 4,
41};
42
43////////////////////////////////////////////////////////////////////////////////////
44//                   global variables
45// These variables must be defined both in boot code and in kernel_init code.
46////////////////////////////////////////////////////////////////////////////////////
47
48extern sbt_lock_t     _tty_tx_lock[NB_TTY_CHANNELS];
49
50extern unsigned int   _tty_rx_buf[NB_TTY_CHANNELS];
51extern unsigned int   _tty_rx_full[NB_TTY_CHANNELS]; 
52
53//////////////////////////////////////////////////////////////////////////////////
54//                    access functions
55//////////////////////////////////////////////////////////////////////////////////
56
57extern unsigned int _tty_get_register( unsigned int channel,
58                                       unsigned int index );
59
60extern void _tty_set_register( unsigned int channel,
61                               unsigned int index,
62                               unsigned int value );
63
64extern void _tty_init( unsigned int channel );
65
66//////////////////////////////////////////////////////////////////////////////////
67//                 Interrupt Service Routine
68///////////////////////////////////////////////////////////////////////////////////
69
70extern void _tty_rx_isr( unsigned int irq_type,
71                         unsigned int irq_id,
72                         unsigned int channel );
73
74extern void _tty_tx_isr( unsigned int irq_type,
75                         unsigned int irq_id,
76                         unsigned int channel );
77
78
79#endif
80
81// Local Variables:
82// tab-width: 4
83// c-basic-offset: 4
84// c-file-offsets:((innamespace . 0)(inline-open . 0))
85// indent-tabs-mode: nil
86// End:
87// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
88
Note: See TracBrowser for help on using the repository browser.