aboutsummaryrefslogtreecommitdiff
path: root/lib/DATS/panic.dats
blob: fc3122b941214b60d38224e17a3a833b5174b48c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
staload "lib/SATS/panic.sats"
staload "lib/SATS/writer.sats"

staload UN = "prelude/SATS/unsafe.sats"

#define ATS_DYNLOADFLAG 0

%{$
  inline void halt() {
    while (1){
      __asm__ volatile ("cli ; hlt");
    }
  }
%}

extern fun halt():<!ntm> void = "mac#"

implement panic_loc(loc,msg) = $effmask_all(
  put_string "KERNEL PANIC:\n   ";
  put_string loc;
  put_string "\n\n    ";
  put_string msg;
  halt();
)