MCPcopy Create free account
hub / github.com/F-Stack/f-stack / simprintf

Function simprintf

freebsd/contrib/octeon-sdk/cvmx-app-init-linux.c:137–148  ·  view source on GitHub ↗

* Simulator magic is not supported in user mode under Linux. * This version of simprintf simply calls the underlying C * library printf for output. It also makes sure that two * calls to simprintf provide atomic output. * * @param format Format string in the same format as printf. */

Source from the content-addressed store, hash-verified

135 * @param format Format string in the same format as printf.
136 */
137void simprintf(const char *format, ...)
138{
139 CVMX_SHARED static cvmx_spinlock_t simprintf_lock = CVMX_SPINLOCK_UNLOCKED_INITIALIZER;
140 va_list ap;
141
142 cvmx_spinlock_lock(&simprintf_lock);
143 printf("SIMPRINTF(%d): ", (int)cvmx_get_core_num());
144 va_start(ap, format);
145 vprintf(format, ap);
146 va_end(ap);
147 cvmx_spinlock_unlock(&simprintf_lock);
148}
149
150
151/**

Callers

nothing calls this directly

Calls 5

cvmx_spinlock_lockFunction · 0.85
cvmx_get_core_numFunction · 0.85
cvmx_spinlock_unlockFunction · 0.85
printfFunction · 0.50
vprintfFunction · 0.50

Tested by

no test coverage detected