[libc] Bring libc in-tree

Moving libc from its separate repo into this one, minor resulting build
fixes, and a hacky way to add -I for libc headers in builds.
This commit is contained in:
2020-08-23 17:21:08 -07:00
parent 28b800a497
commit 95a35cd0bf
216 changed files with 21033 additions and 12 deletions

View File

@@ -1,5 +1,4 @@
#pragma once
#include <algorithm>
#include <stdarg.h>
#include <stdint.h>
@@ -61,7 +60,7 @@ void console::put_hex(T x, int width, char pad)
int len = 1;
for (int i = chars - 1; i >= 0; --i) {
uint8_t nibble = (x >> (i*4)) & 0xf;
if (nibble) len = std::max(i + 1, len);
if (nibble) len = len > i + 1 ? len : i + 1;
message[chars - i - 1] = digits[nibble];
}
message[chars] = 0;

View File

@@ -1,4 +1,3 @@
#include <algorithm>
#include <utility>
#include "kernel_args.h"

View File

@@ -1,5 +1,3 @@
#include <algorithm>
#include "kutil/assert.h"
#include "kutil/vm_space.h"
#include "console.h"

View File

@@ -1,3 +1,5 @@
#include <stddef.h>
#include "apic.h"
#include "clock.h"
#include "console.h"