summaryrefslogtreecommitdiff
path: root/src/user/knob/format.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2020-09-13 18:29:53 -0400
committerBenji Dial <benji6283@gmail.com>2020-09-13 18:29:53 -0400
commit54101cf327b7def90636babbadbb66ce697298ee (patch)
tree4723c6803e855b3a82c4020bb6f287b43a080cb4 /src/user/knob/format.c
parent5481848e27fdd4fc859def9841a0283665531a46 (diff)
downloadportland-os-54101cf327b7def90636babbadbb66ce697298ee.tar.gz
making elf loader zero bss sections
Diffstat (limited to 'src/user/knob/format.c')
-rw-r--r--src/user/knob/format.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/user/knob/format.c b/src/user/knob/format.c
index 645fb73..593b20c 100644
--- a/src/user/knob/format.c
+++ b/src/user/knob/format.c
@@ -12,6 +12,7 @@ bool try_sntoi(const char *s, uint32_t n, uint32_t *out) {
return true;
}
+__attribute__ ((access (write_only, 2)))
void itosz(uint32_t i, char *out) {
if (!i) {
*(uint16_t *)out = (uint16_t)'0';
@@ -32,12 +33,14 @@ void itosz(uint32_t i, char *out) {
const char *const hex_digits = "0123456789abcdef";
+__attribute__ ((access (write_only, 2)))
void itosz_h8(uint8_t i, char *out) {
out[0] = hex_digits[i >> 4];
out[1] = hex_digits[i & 0xf];
out[2] = '\0';
}
+__attribute__ ((access (write_only, 2)))
void itosz_h32(uint32_t i, char *out) {
for (uint8_t digit = 0; digit < 8; ++digit)
out[digit] = hex_digits[(i >> (28 - digit * 4)) & 0xf];