[util] Add util::format replacement for snprintf

The printf library I have been using, while useful, has way more than I
need in it, and had comparably huge stack space requirements. This
change adds a new util::format() which is a replacement for snprintf,
but with only the features used by kernel logging.

The logger has been changed to use it, as well as the few instances of
snprintf in the interrupt handling code before calling kassert.

Also part of this change: the logger's (now vestigial) immediate output
handling code is removed, as well as the "sequence" field on log
message headers.
This commit is contained in:
Justin C. Miller
2022-03-13 17:59:56 -07:00
parent 24f324552a
commit bb0d30610e
8 changed files with 167 additions and 47 deletions

View File

@@ -4,6 +4,7 @@ module("util",
kind = "lib",
sources = [
"bip_buffer.cpp",
"format.cpp",
"spinlock.cpp",
],
public_headers = [
@@ -13,6 +14,7 @@ module("util",
"util/counted.h",
"util/deque.h",
"util/enum_bitfields.h",
"util/format.h",
"util/hash.h",
"util/linked_list.h",
"util/map.h",