GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
ser-unix.c File Reference
#include "defs.h"
#include "serial.h"
#include "ser-base.h"
#include "ser-unix.h"
#include <fcntl.h>
#include <sys/types.h>
#include "terminal.h"
#include <sys/socket.h>
#include "gdbsupport/gdb_sys_time.h"
#include "gdbsupport/gdb_select.h"
#include "gdbcmd.h"
#include "gdbsupport/filestuff.h"
#include <termios.h>
#include "gdbsupport/scoped_ignore_sigttou.h"

Go to the source code of this file.

Classes

struct  hardwire_ttystate
 

Macros

#define B19200   EXTA
 
#define B38400   EXTB
 

Functions

static int hardwire_open (struct serial *scb, const char *name)
 
static void hardwire_raw (struct serial *scb)
 
static int rate_to_code (int rate)
 
static int hardwire_setbaudrate (struct serial *scb, int rate)
 
static int hardwire_setparity (struct serial *scb, int parity)
 
static void hardwire_close (struct serial *scb)
 
static int get_tty_state (struct serial *scb, struct hardwire_ttystate *state)
 
static int set_tty_state (struct serial *scb, struct hardwire_ttystate *state)
 
static serial_ttystate hardwire_get_tty_state (struct serial *scb)
 
static int hardwire_set_tty_state (struct serial *scb, serial_ttystate state)
 
static void hardwire_print_tty_state (struct serial *, serial_ttystate, struct ui_file *)
 
static int hardwire_drain_output (struct serial *)
 
static int hardwire_flush_output (struct serial *)
 
static int hardwire_flush_input (struct serial *)
 
static int hardwire_send_break (struct serial *)
 
static int hardwire_setstopbits (struct serial *, int)
 
static serial_ttystate hardwire_copy_tty_state (struct serial *scb, serial_ttystate ttystate)
 
void _initialize_ser_hardwire ()
 
int ser_unix_read_prim (struct serial *scb, size_t count)
 
int ser_unix_write_prim (struct serial *scb, const void *buf, size_t len)
 

Variables

struct { 
 
   int   rate 
 
   int   code 
 
baudtab [] 
 
static const struct serial_ops hardwire_ops
 

Macro Definition Documentation

◆ B19200

#define B19200   EXTA

Definition at line 230 of file ser-unix.c.

◆ B38400

#define B38400   EXTB

Definition at line 234 of file ser-unix.c.

Function Documentation

◆ _initialize_ser_hardwire()

void _initialize_ser_hardwire ( )

Definition at line 568 of file ser-unix.c.

Referenced by initialize_all_files().

◆ get_tty_state()

static int get_tty_state ( struct serial * scb,
struct hardwire_ttystate * state )
static

◆ hardwire_close()

static void hardwire_close ( struct serial * scb)
static

Definition at line 528 of file ser-unix.c.

References serial::fd.

◆ hardwire_copy_tty_state()

static serial_ttystate hardwire_copy_tty_state ( struct serial * scb,
serial_ttystate ttystate )
static

Definition at line 118 of file ser-unix.c.

◆ hardwire_drain_output()

static int hardwire_drain_output ( struct serial * scb)
static

Definition at line 166 of file ser-unix.c.

References serial::fd.

◆ hardwire_flush_input()

static int hardwire_flush_input ( struct serial * scb)
static

Definition at line 181 of file ser-unix.c.

References serial::fd, and ser_base_flush_input().

◆ hardwire_flush_output()

static int hardwire_flush_output ( struct serial * scb)
static

Definition at line 175 of file ser-unix.c.

References serial::fd.

◆ hardwire_get_tty_state()

static serial_ttystate hardwire_get_tty_state ( struct serial * scb)
static

Definition at line 104 of file ser-unix.c.

References get_tty_state(), and xfree().

◆ hardwire_open()

static int hardwire_open ( struct serial * scb,
const char * name )
static

Definition at line 76 of file ser-unix.c.

References serial::fd, and name.

◆ hardwire_print_tty_state()

static void hardwire_print_tty_state ( struct serial * scb,
serial_ttystate ttystate,
struct ui_file * stream )
static

Definition at line 138 of file ser-unix.c.

References gdb_printf(), and hardwire_ttystate::termios.

◆ hardwire_raw()

static void hardwire_raw ( struct serial * scb)
static

◆ hardwire_send_break()

static int hardwire_send_break ( struct serial * scb)
static

Definition at line 189 of file ser-unix.c.

References serial::fd.

◆ hardwire_set_tty_state()

static int hardwire_set_tty_state ( struct serial * scb,
serial_ttystate state )
static

Definition at line 128 of file ser-unix.c.

References set_tty_state().

◆ hardwire_setbaudrate()

static int hardwire_setbaudrate ( struct serial * scb,
int rate )
static

◆ hardwire_setparity()

static int hardwire_setparity ( struct serial * scb,
int parity )
static

◆ hardwire_setstopbits()

static int hardwire_setstopbits ( struct serial * scb,
int num )
static

◆ rate_to_code()

static int rate_to_code ( int rate)
static

Definition at line 404 of file ser-unix.c.

References baudtab, and rate.

Referenced by hardwire_setbaudrate().

◆ ser_unix_read_prim()

int ser_unix_read_prim ( struct serial * scb,
size_t count )

Definition at line 586 of file ser-unix.c.

References serial::buf, serial::fd, and read().

◆ ser_unix_write_prim()

int ser_unix_write_prim ( struct serial * scb,
const void * buf,
size_t len )

Definition at line 592 of file ser-unix.c.

References serial::fd, and serial_ops::write.

◆ set_tty_state()

static int set_tty_state ( struct serial * scb,
struct hardwire_ttystate * state )
static

Variable Documentation

◆ [struct]

struct { ... } baudtab[]

Referenced by rate_to_code().

◆ code

int code

Definition at line 243 of file ser-unix.c.

◆ hardwire_ops

const struct serial_ops hardwire_ops
static
Initial value:
=
{
"hardwire",
NULL,
}
void ser_base_async(struct serial *scb, int async_p)
Definition ser-base.c:587
int ser_base_write(struct serial *scb, const void *buf, size_t count)
Definition ser-base.c:475
int ser_base_readchar(struct serial *scb, int timeout)
Definition ser-base.c:469
static int hardwire_flush_output(struct serial *)
Definition ser-unix.c:175
static void hardwire_print_tty_state(struct serial *, serial_ttystate, struct ui_file *)
Definition ser-unix.c:138
static int hardwire_setstopbits(struct serial *, int)
Definition ser-unix.c:464
static int hardwire_open(struct serial *scb, const char *name)
Definition ser-unix.c:76
static int hardwire_drain_output(struct serial *)
Definition ser-unix.c:166
int ser_unix_write_prim(struct serial *scb, const void *buf, size_t len)
Definition ser-unix.c:592
static serial_ttystate hardwire_copy_tty_state(struct serial *scb, serial_ttystate ttystate)
Definition ser-unix.c:118
static int hardwire_flush_input(struct serial *)
Definition ser-unix.c:181
static void hardwire_close(struct serial *scb)
Definition ser-unix.c:528
static serial_ttystate hardwire_get_tty_state(struct serial *scb)
Definition ser-unix.c:104
static int hardwire_setparity(struct serial *scb, int parity)
Definition ser-unix.c:496
int ser_unix_read_prim(struct serial *scb, size_t count)
Definition ser-unix.c:586
static int hardwire_send_break(struct serial *)
Definition ser-unix.c:189
static int hardwire_set_tty_state(struct serial *scb, serial_ttystate state)
Definition ser-unix.c:128
static int hardwire_setbaudrate(struct serial *scb, int rate)
Definition ser-unix.c:441
static void hardwire_raw(struct serial *scb)
Definition ser-unix.c:195

Definition at line 541 of file ser-unix.c.

◆ rate

int rate