OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [sys/] [sysnec810/] [write.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
static volatile char *data = (char *)(0x20);
2
static volatile char *control = (char *)(0x24);
3
 
4
extern void _outb (volatile char*, unsigned char);
5
extern unsigned char _inb (volatile char*);
6
 
7
static unsigned char
8
 read_scc_reg (unsigned char n)
9
{
10
  _outb (control, n);
11
  return _inb(control);
12
}
13
 
14
static void write_scc_data (unsigned char n)
15
{
16
  _outb (data, n);
17
}
18
 
19
int
20
_write (int dev, void *buf, unsigned int len)
21
{
22
  int i;
23
  char *string = (char*)buf;
24
 
25
  for (i = 0; i < len; i++)
26
    {
27
      int j;
28
 
29
      for (j = 0 ; j < 5000; j++)
30
        ;
31
      write_scc_data (string[i]);
32
 
33
    }
34
  return len;
35
}
36
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.