OpenOCD
replacements.h File Reference
Include dependency graph for replacements.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Elf32_Ehdr
 
struct  Elf32_Phdr
 
struct  Elf64_Ehdr
 
struct  Elf64_Phdr
 
struct  timeval
 

Macros

#define _TIMEVAL_DEFINED
 
#define EI_CLASS   4 /* File class byte index */
 
#define EI_DATA   5 /* Data encoding byte index */
 
#define EI_NIDENT   16
 
#define ELFCLASS32   1 /* 32-bit objects */
 
#define ELFCLASS64   2 /* 64-bit objects */
 
#define ELFDATA2LSB   1 /* 2's complement, little endian */
 
#define ELFDATA2MSB   2 /* 2's complement, big endian */
 
#define ELFMAG   "\177ELF"
 
#define ENOTSUP   134 /* Not supported */
 
#define MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define O_BINARY   0
 
#define PT_LOAD   1 /* Loadable program segment */
 
#define SELFMAG   4
 

Typedefs

typedef uint32_t Elf32_Addr
 
typedef uint16_t Elf32_Half
 
typedef uint32_t Elf32_Off
 
typedef uint32_t Elf32_Size
 
typedef uint32_t Elf32_Word
 
typedef uint64_t Elf64_Addr
 
typedef uint16_t Elf64_Half
 
typedef uint64_t Elf64_Off
 
typedef uint32_t Elf64_Word
 
typedef uint64_t Elf64_Xword
 

Functions

void * clear_malloc (size_t size)
 
static int close_socket (int sock)
 
void * fill_malloc (size_t size)
 
int gettimeofday (struct timeval *tv, struct timezone *tz)
 
static int read_socket (int handle, void *buffer, unsigned int count)
 
static void socket_block (int fd)
 
static void socket_nonblock (int fd)
 
static int socket_select (int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv)
 
char * strndup (const char *s, size_t n)
 
size_t strnlen (const char *s, size_t maxlen)
 
static int write_socket (int handle, const void *buffer, unsigned int count)
 

Macro Definition Documentation

◆ _TIMEVAL_DEFINED

#define _TIMEVAL_DEFINED

Definition at line 43 of file replacements.h.

◆ EI_CLASS

#define EI_CLASS   4 /* File class byte index */

Definition at line 259 of file replacements.h.

◆ EI_DATA

#define EI_DATA   5 /* Data encoding byte index */

Definition at line 263 of file replacements.h.

◆ EI_NIDENT

#define EI_NIDENT   16

Definition at line 237 of file replacements.h.

◆ ELFCLASS32

#define ELFCLASS32   1 /* 32-bit objects */

Definition at line 260 of file replacements.h.

◆ ELFCLASS64

#define ELFCLASS64   2 /* 64-bit objects */

Definition at line 261 of file replacements.h.

◆ ELFDATA2LSB

#define ELFDATA2LSB   1 /* 2's complement, little endian */

Definition at line 264 of file replacements.h.

◆ ELFDATA2MSB

#define ELFDATA2MSB   2 /* 2's complement, big endian */

Definition at line 265 of file replacements.h.

◆ ELFMAG

#define ELFMAG   "\177ELF"

Definition at line 256 of file replacements.h.

◆ ENOTSUP

#define ENOTSUP   134 /* Not supported */

Definition at line 31 of file replacements.h.

◆ MAX

#define MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 25 of file replacements.h.

◆ MIN

#define MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 22 of file replacements.h.

◆ O_BINARY

#define O_BINARY   0

Definition at line 37 of file replacements.h.

◆ PT_LOAD

#define PT_LOAD   1 /* Loadable program segment */

Definition at line 278 of file replacements.h.

◆ SELFMAG

#define SELFMAG   4

Definition at line 257 of file replacements.h.

Typedef Documentation

◆ Elf32_Addr

typedef uint32_t Elf32_Addr

Definition at line 231 of file replacements.h.

◆ Elf32_Half

typedef uint16_t Elf32_Half

Definition at line 232 of file replacements.h.

◆ Elf32_Off

typedef uint32_t Elf32_Off

Definition at line 233 of file replacements.h.

◆ Elf32_Size

typedef uint32_t Elf32_Size

Definition at line 235 of file replacements.h.

◆ Elf32_Word

typedef uint32_t Elf32_Word

Definition at line 234 of file replacements.h.

◆ Elf64_Addr

typedef uint64_t Elf64_Addr

Definition at line 284 of file replacements.h.

◆ Elf64_Half

typedef uint16_t Elf64_Half

Definition at line 285 of file replacements.h.

◆ Elf64_Off

typedef uint64_t Elf64_Off

Definition at line 286 of file replacements.h.

◆ Elf64_Word

typedef uint32_t Elf64_Word

Definition at line 287 of file replacements.h.

◆ Elf64_Xword

typedef uint64_t Elf64_Xword

Definition at line 288 of file replacements.h.

Function Documentation

◆ clear_malloc()

void* clear_malloc ( size_t  size)

Definition at line 22 of file replacements.c.

References size.

◆ close_socket()

◆ fill_malloc()

void* fill_malloc ( size_t  size)

Definition at line 30 of file replacements.c.

References size.

◆ gettimeofday()

◆ read_socket()

static int read_socket ( int  handle,
void *  buffer,
unsigned int  count 
)
inlinestatic

Definition at line 176 of file replacements.h.

References buffer, and count.

Referenced by connection_read(), gdb_get_char_inner(), jtag_vpi_receive_cmd(), and remote_bitbang_fill_buf().

◆ socket_block()

static void socket_block ( int  fd)
inlinestatic

Definition at line 194 of file replacements.h.

Referenced by remote_bitbang_fill_buf().

◆ socket_nonblock()

static void socket_nonblock ( int  fd)
inlinestatic

Definition at line 205 of file replacements.h.

Referenced by add_service(), remote_bitbang_fill_buf(), and remote_bitbang_init().

◆ socket_select()

static int socket_select ( int  max_fd,
fd_set *  rfds,
fd_set *  wfds,
fd_set *  efds,
struct timeval tv 
)
inlinestatic

Definition at line 216 of file replacements.h.

Referenced by check_pending(), and server_loop().

◆ strndup()

char* strndup ( const char *  s,
size_t  n 
)

◆ strnlen()

size_t strnlen ( const char *  s,
size_t  maxlen 
)

Definition at line 103 of file replacements.c.

Referenced by adapter_usb_location_equal(), and strndup().

◆ write_socket()

static int write_socket ( int  handle,
const void *  buffer,
unsigned int  count 
)
inlinestatic

Definition at line 167 of file replacements.h.

References buffer, and count.

Referenced by connection_write(), jtag_vpi_send_cmd(), and remote_bitbang_flush().