ref: d4043e96060df9abaab72c2acee4a548f43dba4e
parent: bf3a3cdf187ea5a99386a2848a468cd2e79c3e43
author: Ori Bernstein <[email protected]>
date: Mon Apr 27 10:19:37 EDT 2020
fix drawterm compiles using gcc 10 -fno-common became the default, and and kmesg was relying on common symbols being merged.
--- a/kern/dat.h
+++ b/kern/dat.h
@@ -32,6 +32,7 @@
typedef struct RWlock RWlock;
typedef struct Waitq Waitq;
typedef struct Walkqid Walkqid;
+typedef struct Kmesg Kmesg;
typedef int Devgen(Chan*, char*, Dirtab*, int, int, Dir*);
#include "fcall.h"
@@ -477,8 +478,10 @@
* Log console output so it can be retrieved via /dev/kmesg.
* This is good for catching boot-time messages after the fact.
*/
-struct {
+struct Kmesg {
Lock lk;
uint n;
char buf[16384];
-} kmesg;
+};
+
+extern Kmesg kmesg;
--- a/kern/devcons.c
+++ b/kern/devcons.c
@@ -13,6 +13,7 @@
void (*screenputs)(char*, int) = 0;
+Kmesg kmesg; /* console messages */
Queue* kbdq; /* unprocessed console input */
Queue* lineq; /* processed console input */
Queue* kprintoq; /* console output, for /dev/kprint */