AcessNative - Compile fixes after select() implementation
[tpg/acess2.git] / AcessNative / acesskernel_src / helpers.c
1 /*
2  * Acess2 Native Kernel
3  * - Acess kernel emulation on another OS using SDL and UDP
4  *
5  * Kernel Main
6  */
7 #include <arch.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <stdarg.h>
11 #include <sys/time.h>
12
13 void LogF(const char *Fmt, ...)
14 {
15         va_list args;
16         va_start(args, Fmt);
17         vprintf(Fmt, args);
18         va_end(args);
19 }
20
21 void Log(const char *Fmt, ...)
22 {
23         va_list args;
24         printf("Log: ");
25         va_start(args, Fmt);
26         vprintf(Fmt, args);
27         va_end(args);
28         printf("\n");
29 }
30
31 void Warning(const char *Fmt, ...)
32 {
33         va_list args;
34         printf("Warning: ");
35         va_start(args, Fmt);
36         vprintf(Fmt, args);
37         va_end(args);
38         printf("\n");
39 }
40
41 void Panic(const char *Format, ...)
42 {
43         va_list args;
44         printf("Panic: ");
45         va_start(args, Format);
46         vprintf(Format, args);
47         va_end(args);
48         printf("\n");
49         exit(-1);
50 }
51
52 void Debug_SetKTerminal(const char *Path)
53 {
54         // Ignored, kernel debug goes to stdout
55 }
56
57 void *Heap_Allocate(const char *File, int Line, int ByteCount)
58 {
59         return malloc(ByteCount);
60 }
61
62 tPAddr MM_GetPhysAddr(tVAddr VAddr)
63 {
64         return VAddr;   // HACK!
65 }
66
67 Uint MM_GetFlags(tVAddr VAddr)
68 {
69         return 0;
70 }
71
72 int Modules_InitialiseBuiltin(const char *Name)
73 {
74         return 0;       // Ignored
75 }
76
77 Sint64 now(void)
78 {
79         struct timeval tv;
80         struct timezone tz;
81         gettimeofday(&tv, &tz);
82         return tv.tv_sec * 1000 + tv.tv_usec/1000;
83 }
84

UCC git Repository :: git.ucc.asn.au