Back to index

glibc  2.9
Classes | Defines | Functions
console.c File Reference
#include <standalone.h>
#include "m68020.h"

Go to the source code of this file.

Classes

struct  r_m681_info
struct  w_m681_info

Defines

#define RD_M68681   ((r_m681_info *)0xfffb0040) /* ptr to the M68681 */
#define WR_M68681   ((w_m681_info *)0xfffb0040) /* ptr to the M68681 */
#define RXRDYB   0x01 /* status reg recv ready mask */
#define TXRDYB   0x04 /* status reg trans ready mask */
#define XON   0x11 /* control-Q */
#define XOFF   0x13 /* control-S */

Functions

int _Console_Putc (char ch)
int _Console_Getc (int poll)

Class Documentation

struct r_m681_info

Definition at line 33 of file console.c.

Class Members
volatile unsigned char fill1
volatile unsigned char fill2
volatile unsigned char fill3
volatile unsigned char isr
volatile unsigned char ivr
volatile unsigned char mr1mr2b
volatile unsigned char rbb
volatile unsigned char srb
struct w_m681_info

Definition at line 44 of file console.c.

Class Members
volatile unsigned char acr
volatile unsigned char crb
volatile unsigned char csrb
volatile unsigned char fill1
volatile unsigned char fill2
volatile unsigned char imr
volatile unsigned char ivr
volatile unsigned char mr1mr2b
volatile unsigned char tbb

Define Documentation

#define RD_M68681   ((r_m681_info *)0xfffb0040) /* ptr to the M68681 */

Definition at line 56 of file console.c.

#define RXRDYB   0x01 /* status reg recv ready mask */

Definition at line 58 of file console.c.

#define TXRDYB   0x04 /* status reg trans ready mask */

Definition at line 59 of file console.c.

#define WR_M68681   ((w_m681_info *)0xfffb0040) /* ptr to the M68681 */

Definition at line 57 of file console.c.

#define XOFF   0x13 /* control-S */

Definition at line 67 of file console.c.

#define XON   0x11 /* control-Q */

Definition at line 66 of file console.c.


Function Documentation

int _Console_Getc ( int  poll)

Definition at line 89 of file console.c.

{
  if ( poll ) {
    if ( !(RD_M68681->srb & RXRDYB) )
      return -1;
    else
      return RD_M68681->rbb;
  } else {
    while ( !(RD_M68681->srb & RXRDYB) );
    return RD_M68681->rbb;
  }
}
int _Console_Putc ( char  ch)

Definition at line 70 of file console.c.

{
  while ( ! (RD_M68681->srb & TXRDYB) ) ;
  while ( RD_M68681->srb & RXRDYB )        /* must be an XOFF */
    if ( RD_M68681->rbb == XOFF )
      do {
        while ( ! (RD_M68681->srb & RXRDYB) ) ;
      } while ( RD_M68681->rbb != XON );

  WR_M68681->tbb = ch;
  return( 0 );
}

Here is the call graph for this function: