gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
atomicio.hh File Reference
#include <unistd.h>

Go to the source code of this file.

Macros

#define STATIC_MSG(fd, m)
 Statically allocate a string and write it to a file descriptor. More...
 
#define STATIC_ERR(m)   STATIC_MSG(STDERR_FILENO, m)
 Statically allocate a string and write it to STDERR. More...
 

Functions

ssize_t atomic_read (int fd, void *s, size_t n)
 
ssize_t atomic_write (int fd, const void *s, size_t n)
 

Macro Definition Documentation

#define STATIC_ERR (   m)    STATIC_MSG(STDERR_FILENO, m)

Statically allocate a string and write it to STDERR.

Warning
The return value will from atomic_write will be ignored which means that errors will be ignored. This is normally fine as this macro is intended to be used in fatal signal handlers where error handling might not be feasible.

Definition at line 66 of file atomicio.hh.

Referenced by abortHandler(), print_backtrace(), raiseFatalSignal(), and segvHandler().

#define STATIC_MSG (   fd,
 
)
Value:
do { \
static const char msg[] = m; \
atomic_write(fd, msg, sizeof(msg) - 1); \
} while (0)
Bitfield< 0 > m
Definition: miscregs.hh:1577
ssize_t atomic_write(int fd, const void *s, size_t n)
Definition: atomicio.cc:66
Bitfield< 14, 12 > fd
Definition: types.hh:155

Statically allocate a string and write it to a file descriptor.

Warning
The return value will from atomic_write will be ignored which means that errors will be ignored. This is normally fine as this macro is intended to be used in fatal signal handlers where error handling might not be feasible.

Definition at line 52 of file atomicio.hh.

Function Documentation

ssize_t atomic_read ( int  fd,
void *  s,
size_t  n 
)

Definition at line 37 of file atomicio.cc.

References MipsISA::p, and ArmISA::s.

ssize_t atomic_write ( int  fd,
const void *  s,
size_t  n 
)

Definition at line 66 of file atomicio.cc.

References MipsISA::p, and ArmISA::s.

Referenced by Terminal::accept(), VncServer::accept(), Terminal::write(), and VncServer::write().


Generated on Fri Jun 9 2017 13:03:56 for gem5 by doxygen 1.8.6