source: rtems/c/src/lib/libbsp/i386/shared/comm/i386_io.h @ b459526

4.104.114.84.95
Last change on this file since b459526 was b459526, checked in by Joel Sherrill <joel.sherrill@…>, on 08/30/00 at 08:18:56

2000-08-26 Rosimildo da Silva <rdasilva@…>

  • shared/comm: Added "/dev/ttyS1" & "/dev/ttyS2" support for the i386 BSPs.
  • shared/comm/gdb_glue.c: New file.
  • shared/comm/i386_io.c: New file.
  • shared/comm/tty_drv.c: New file.
  • shared/comm/tty_drv.h: New file.
  • shared/comm/Makefile.am: Account for new files.
  • shared/comm/uart.c: Adds support for sending characters to another "line discipline."
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2/////////////////////////////////////////////////////////////////////////////
3// $Header$
4//
5// Copyright (c) 2000 - Rosimildo da Silva.  All Rights Reserved.
6// 
7// MODULE DESCRIPTION:
8//
9// IO Functions for the PC platform equivalent to DOS/Linux. They make
10// eaiser the porting of code from these platforms.
11//
12//  by: Rosimildo da Silva:  rdasilva@connecttel.com
13//
14// MODIFICATION/HISTORY:
15// $Log$
16//
17/////////////////////////////////////////////////////////////////////////////
18*/
19
20#ifndef i386_io_h__
21#define i386_io_h__
22
23#define rtems_inb(port)                                                 \
24({                                                                      \
25        register int _inb_result;                                       \
26                                                        \
27        asm volatile ("xorl %%eax,%%eax; inb %%dx,%%al" :               \
28            "=a" (_inb_result) : "d" (port));                           \
29        _inb_result;                                                    \
30})
31
32#define rtems_inw(port)                                                 \
33({                                                                      \
34        register int _inbw_result;                                      \
35                                                                        \
36        asm volatile ("xorl %%eax,%%eax; inw %%dx,%%ax" :               \
37            "=a" (_inbw_result) : "d" (port));                          \
38        _inbw_result;                                                   \
39})
40
41#define rtems_outb(port, data)                                          \
42        asm volatile ("outb %%al,%%dx" : : "a" (data), "d" (port))
43
44#define rtems_outw(port, data)                                          \
45        asm volatile ("outw %%ax,%%dx" : : "a" (data), "d" (port))
46
47#define outp(port, val) rtems_outb(port,val)
48#define inp(port)             rtems_inb(port)
49
50#define outb(val, port) rtems_outb(port,val)
51#define inb(port)             rtems_inb(port)
52
53#define outb_p(val, port)       rtems_outb(port,val)
54#define inb_p(port)           rtems_inb(port)
55
56#define outportb(port,val)      rtems_outb(port,val)
57#define inportb(port)   rtems_inb(port)
58
59#define outw(val, port) rtems_outw(port,val)
60#define inw(port)             rtems_inw(port)
61
62#define cli()   __asm__ __volatile__("cli")
63#define sti()   __asm__ __volatile__("sti");
64
65#endif /* i386_io_h__ */
66
Note: See TracBrowser for help on using the repository browser.