/shark/trunk/oslib/kl/event.c |
---|
181,7 → 181,7 |
TRACER_LOGEVENT(FTrace_EVT_timer_wakeup_start, 0, 0); |
if (use_tsc) { |
if (!use_tsc) { |
tmp = pit_read(frc); |
ADDPITSPEC((WORD) (lastTime - tmp), &globalCounter); |
lastTime = tmp; |
/shark/trunk/oslib/ll/i386/stdlib.h |
---|
30,6 → 30,13 |
#define EXIT_FAILURE 1 /* Failing exit status. */ |
#define EXIT_SUCCESS 0 /* Successful exit status. */ |
/* Added by Nino - Begin */ |
#define EXIT_MODE_HALT 0 /* End the system using the 'hlt' instruction. */ |
#define EXIT_MODE_COLD 1 /* End the system with a _cold_ reboot. */ |
#define EXIT_MODE_WARM 2 /* End the system with a _warm_ reboot. */ |
#define EXIT_MODE_REAL 3 /* End the system returning in real-mode. */ |
/* Added by Nino - End */ |
#ifndef NULL |
#define NULL 0L |
#endif |
69,8 → 76,8 |
/* The stdlib exit functions */ |
void l1_exit(int code); |
int ll_set_reboot(int mode); |
/* Stdlib Macro */ |
#ifndef __WC16__ |
#define labs(x) abs(x) |
/shark/trunk/oslib/libc/stdlib/stdlib.c |
---|
19,21 → 19,57 |
* For legalese, check out the included GPL license. |
*/ |
#include <ll/i386/hw-func.h> |
#include <ll/i386/stdlib.h> |
#include <ll/unistd.h> |
FILE(stdlib); |
int ll_exit_mode = EXIT_MODE_REAL; |
unsigned abs(int x) |
{ |
if (x < 0) return(-x); |
else return(x); |
if (x < 0) return(-x); |
else return(x); |
} |
int ll_set_reboot(int mode) |
{ |
switch(mode) { |
case EXIT_MODE_HALT: |
ll_exit_mode = EXIT_MODE_HALT; |
break; |
case EXIT_MODE_COLD: |
ll_exit_mode = EXIT_MODE_COLD; |
break; |
case EXIT_MODE_WARM: |
ll_exit_mode = EXIT_MODE_WARM; |
break; |
default: |
ll_exit_mode = EXIT_MODE_REAL; |
break; |
} |
return ll_exit_mode; |
} |
void l1_exit(int code) |
{ |
extern void bios_restore(void); |
extern void bios_restore(void); |
bios_restore(); |
__exit(code); |
bios_restore(); |
switch (ll_exit_mode) { |
case EXIT_MODE_HALT: |
halt(); |
break; |
case EXIT_MODE_COLD: |
cold_reboot(); |
break; |
case EXIT_MODE_WARM: |
warm_reboot(); |
break; |
default: |
__exit(code); |
break; |
} |
} |