aboutsummaryrefslogtreecommitdiff
path: root/lib/DATS/panic.dats
blob: 356eda5002ee9f93b9965f5d20f4427491852693 (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) = (
  put_string "KERNEL PANIC:\n   ";
  put_string loc;
  put_string "\n\n    ";
  put_string msg;
  halt();
)