summaryrefslogtreecommitdiff
path: root/include/kernel/tty.h
blob: b3f301249f79b626f85bd80190528a8133b8a526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef _TTY_H
#define _TTY_H

#include <kernel/sched.h>
#include <sys/types.h>

#define TTY_BUF_SIZE 1024

struct tty_queue {
  unsigned pread;
  unsigned pwrite;
  struct task_struct *waiting;
  char buf[TTY_BUF_SIZE];
};

struct tty_struct {
  void (*init) (void);
  struct tty_queue rqueue;
  struct tty_queue wqueue;
};

ssize_t tty_read(unsigned, void*, size_t);

void tty_init(void);

#endif