CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
plugin_log_bridge.cpp File Reference

cdc_log bridge for the plugin manager translation units that need to coexist with wasm_export.h. More...

#include "cdc_log.h"
#include <atomic>

Go to the source code of this file.

Functions

void plg_log_info (const char *msg)
void plg_log_warn (const char *msg)
void plg_log_error (const char *msg)
void plg_set_active_plugin (void *p)
void * plg_get_active_plugin (void)

Variables

static const char * TAG = "PLUGIN"
static std::atomic< void * > s_active_plugin {nullptr}

Detailed Description

cdc_log bridge for the plugin manager translation units that need to coexist with wasm_export.h.

wasm_export.h and cdc_log.h both define log_level_t. Any source file that wants both has to go through this bridge. It also tracks the currently active Plugin pointer so the per-call capability checks in the host_api_* implementations can look up which manifest applies.

Definition in file plugin_log_bridge.cpp.

Function Documentation

◆ plg_get_active_plugin()

◆ plg_log_error()

void plg_log_error ( const char * msg)

◆ plg_log_info()

void plg_log_info ( const char * msg)

Definition at line 19 of file plugin_log_bridge.cpp.

References LOG_I, and TAG.

Referenced by cdc::plugin_manager::register_host_imports().

◆ plg_log_warn()

void plg_log_warn ( const char * msg)

◆ plg_set_active_plugin()

void plg_set_active_plugin ( void * p)

Definition at line 23 of file plugin_log_bridge.cpp.

References s_active_plugin.

Referenced by cdc::plugin_manager::Plugin::callI().

Variable Documentation

◆ s_active_plugin

std::atomic<void*> s_active_plugin {nullptr}
static

Definition at line 17 of file plugin_log_bridge.cpp.

Referenced by plg_get_active_plugin(), and plg_set_active_plugin().

◆ TAG

const char* TAG = "PLUGIN"
static

Definition at line 16 of file plugin_log_bridge.cpp.