gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
atomicio.hh File Reference
#include <unistd.h>

Go to the source code of this file.

Namespaces

namespace  gem5
 Copyright (c) 2024 Arm Limited All rights reserved.
 

Macros

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

Functions

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

Macro Definition Documentation

◆ STATIC_ERR

#define STATIC_ERR ( m)
Value:
STATIC_MSG(STDERR_FILENO, m)
#define STATIC_MSG(fd, m)
Statically allocate a string and write it to a file descriptor.
Definition atomicio.hh:53

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 67 of file atomicio.hh.

Referenced by gem5::abortHandler(), gem5::trace::OstreamLogger::logMessage(), gem5::print_backtrace(), gem5::raiseFatalSignal(), and gem5::segvHandler().

◆ STATIC_MSG

#define STATIC_MSG ( fd,
m )
Value:
do { \
static const char msg[] = m; \
atomic_write(fd, msg, sizeof(msg) - 1); \
} while (0)

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 53 of file atomicio.hh.


Generated on Mon May 26 2025 09:19:16 for gem5 by doxygen 1.13.2