/shark/trunk/include/kernel/func.h |
---|
21,11 → 21,11 |
/** |
------------ |
CVS : $Id: func.h,v 1.13 2004-04-19 15:25:38 giacomo Exp $ |
CVS : $Id: func.h,v 1.14 2004-05-10 18:16:00 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.13 $ |
Last update: $Date: 2004-04-19 15:25:38 $ |
Revision: $Revision: 1.14 $ |
Last update: $Date: 2004-05-10 18:16:00 $ |
------------ |
Kernel functions: |
209,6 → 209,9 |
VM_end |
*/ |
/* Exit mode selection */ |
#define sys_set_reboot ll_set_reboot |
/* Context management routines */ |
#define kern_context_create ll_context_create |
#define kern_context_delete ll_context_delete |
/shark/trunk/shark.cfg |
---|
15,7 → 15,7 |
# Enable timer interrupt through P6 APIC instead of PIT |
# Only P6 or higher CPU class, TSC support must be enabled |
APIC = FALSE |
APIC = TRUE |
# Enable TSC Read Timer Optimization |
# TIMER_OPT = 1000 (For CPU < 1 GHz - Wraparound 585 years) |
26,7 → 26,7 |
# Select the events tracer |
# TRACER = NO,OLD,NEW |
TRACER = NO |
TRACER = NEW |
# Select the BIOS INTERRUPT access mode |
# BIOS = X,VM86 |
/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; |
} |
} |