Vystem 0.2

This commit is contained in:
2026-05-27 19:34:54 +02:00
parent a43c08b893
commit d238606b75
372 changed files with 51320 additions and 83217 deletions

View File

@@ -12,6 +12,7 @@ typedef sh_uint8 sh_log_OUTPUT_TYPE;
#define SH_LOG_CRITICAL ((sh_log_OUTPUT_TYPE)4)
#define SH_LOG_FATAL ((sh_log_OUTPUT_TYPE)5)
#define SH_LOG_TEST ((sh_log_OUTPUT_TYPE)6)
#define SH_LOG_FAULT ((sh_log_OUTPUT_TYPE)7)
typedef sh_uint16 sh_log_OUTPUT_SOURCE;
#define SH_LOG_SOURCE_MAIN ((sh_log_OUTPUT_SOURCE)0)
#define SH_LOG_SOURCE_CONF ((sh_log_OUTPUT_SOURCE)1)
@@ -22,6 +23,11 @@ typedef sh_uint16 sh_log_OUTPUT_SOURCE;
#define SH_LOG_SOURCE_PBA ((sh_log_OUTPUT_SOURCE)6)
#define SH_LOG_SOURCE_HEAP ((sh_log_OUTPUT_SOURCE)7)
#define SH_LOG_SOURCE_STD ((sh_log_OUTPUT_SOURCE)8)
#define SH_LOG_SOURCE_MEMS ((sh_log_OUTPUT_SOURCE)9)
#define SH_LOG_SOURCE_CPUF ((sh_log_OUTPUT_SOURCE)10)
#define SH_LOG_SOURCE_ACPI ((sh_log_OUTPUT_SOURCE)11)
#define SH_LOG_SOURCE_TSC ((sh_log_OUTPUT_SOURCE)12)
#define SH_LOG_SOURCE_SMP ((sh_log_OUTPUT_SOURCE)13)
typedef struct {
sh_log_OUTPUT_TYPE output_type;
sh_log_OUTPUT_SOURCE output_source;
@@ -30,11 +36,11 @@ typedef struct {
} sh_log_OUTPUT_PAYLOAD;
// Return SH_TRUE if provided output type is valid.
static inline sh_bool sh_log_output_type_valid(sh_log_OUTPUT_TYPE t) {
return t<=SH_LOG_TEST;
return t<=SH_LOG_FAULT;
}
// Return SH_TRUE if provided source type is valid.
static inline sh_bool sh_log_output_source_valid(sh_log_OUTPUT_SOURCE s) {
return s<=SH_LOG_SOURCE_STD;
return s<=SH_LOG_SOURCE_SMP;
}
// Load serial logging setting
void sh_log_load_serial_setting(sh_bool is_disabled);
@@ -46,6 +52,8 @@ void sh_log_load_logging_ring_size(sh_uint16 pages_count);
sh_uint32 sh_log_get_logging_ring_size();
// Return total bytes written to the ring buffer
sh_uint64 sh_log_get_total_bytes_written();
// Disable global logging ring, should only be used after SMP is enabled
void sh_log_disable_global_logging_ring();
// Log a byte
void sh_log_byte(sh_uint8 byte);
// Log a string
@@ -103,6 +111,8 @@ SH_STATUS sh_log_error(const char* str,sh_log_OUTPUT_SOURCE source);
SH_STATUS sh_log_critical(const char* str,sh_log_OUTPUT_SOURCE source);
// Print a string to fatal channel, from provided source.
SH_STATUS sh_log_fatal(const char* str,sh_log_OUTPUT_SOURCE source);
// Print a string to fault channel, from provided source.
SH_STATUS sh_log_fault(const char* str,sh_log_OUTPUT_SOURCE source);
// Print a string to test channel. Doesn't include the new line caracter.
SH_STATUS sh_log_ltest(const char* str);
// Print a string to debug channel, from provided source. Doesn't include the new line caracter.
@@ -117,6 +127,8 @@ SH_STATUS sh_log_lerror(const char* str,sh_log_OUTPUT_SOURCE source);
SH_STATUS sh_log_lcritical(const char* str,sh_log_OUTPUT_SOURCE source);
// Print a string to fatal channel, from provided source. Doesn't include the new line caracter.
SH_STATUS sh_log_lfatal(const char* str,sh_log_OUTPUT_SOURCE source);
// Print a string to fault channel, from provided source. Doesn't include the new line caracter.
SH_STATUS sh_log_lfault(const char* str,sh_log_OUTPUT_SOURCE source);
// The following functions format the output before logging it. The syntax is as follow:
// - %s : char*
// - %d : double
@@ -141,6 +153,8 @@ SH_STATUS sh_log_ferror(const sh_log_OUTPUT_SOURCE source,const char* format,...
SH_STATUS sh_log_fcritical(const sh_log_OUTPUT_SOURCE source,const char* format,...);
// Print a string to fatal channel, from provided source. Format it before hand
SH_STATUS sh_log_ffatal(const sh_log_OUTPUT_SOURCE source,const char* format,...);
// Print a string to fault channel, from provided source. Format it before hand
SH_STATUS sh_log_ffault(const sh_log_OUTPUT_SOURCE source,const char* format,...);
// Print every information about memory statictics. Require log level to be 1 or 0
SH_STATUS sh_log_mem_stats(sh_log_OUTPUT_SOURCE source);
#endif