Changeset 973be64e in mainline for generic/include/console/chardev.h


Ignore:
Timestamp:
2005-12-10T00:19:57Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fcfac420
Parents:
705b4149
Message:

Added generic exc_register/exc_dispatch functions,
copied from ia32 architecture. Currently only mips32 uses them.

The chardev_t can now be both input & output device (was
needed for serial driver).

Broken other architectures - ia64, sparc, powerpc will not compile.

Mips32 supports input on all msim, gxemul, indy(tested emulation
in gxemul, loses characters), simics. Simics serial line
is done using polling, I was unable to make it produce
an interrupt when the key was pressed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/include/console/chardev.h

    r705b4149 r973be64e  
    3737#define CHARDEV_BUFLEN 512
    3838
     39struct chardev;
     40
    3941/* Character device operations interface. */
    4042struct chardev_operations {
    41         void (* suspend)(void);         /**< Suspend pushing characters. */
    42         void (* resume)(void);          /**< Resume pushing characters. */
     43        void (* suspend)(struct chardev *);/**< Suspend pushing characters. */
     44        void (* resume)(struct chardev *); /**< Resume pushing characters. */
     45        /** Write character to stream */
     46        void (* write)(struct chardev *, char c);
    4347};
    4448
     
    4751/** Character input device. */
    4852struct chardev {
     53        char *name;
     54       
    4955        waitq_t wq;
    5056        spinlock_t lock;                /**< Protects everything below. */
    5157        __u8 buffer[CHARDEV_BUFLEN];
    5258        count_t counter;
     59        chardev_operations_t *op;       /**< Implementation of chardev operations. */
    5360        index_t index;
    54         chardev_operations_t *op;       /**< Implementation of chardev operations. */
     61        void *data;
    5562};
    5663
    57 extern void chardev_initialize(chardev_t *chardev, chardev_operations_t *op);
     64extern void chardev_initialize(char *name,
     65                               chardev_t *chardev,
     66                               chardev_operations_t *op);
    5867void chardev_push_character(chardev_t *chardev, __u8 ch);
    5968
Note: See TracChangeset for help on using the changeset viewer.