ia64/xen-unstable

view stubdom/caml/main-caml.c @ 18521:e61c7833dc9d

CPUIDLE: Handle C2 LAPIC timer & TSC stop

ACPI C2 is quite possible mapped to CPU C3 or deeper state, so
thinking from worst cases, enable C3 like entry/exit handling for C2
by default. Option 'lapic_timer_c2_ok' can be used to select simple C2
entry/exit only if the user make sure that LAPIC tmr & TSC will not be
stop during C2.

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Sep 22 11:24:02 2008 +0100 (2008-09-22)
parents 460f72ca97b6
children
line source
1 /*
2 * Caml bootstrap
3 *
4 * Samuel Thibault <Samuel.Thibault@eu.citrix.net>, January 2008
5 */
7 #include <stdio.h>
8 #include <errno.h>
10 #include <caml/mlvalues.h>
11 #include <caml/callback.h>
12 #include <unistd.h>
14 /* Ugly binary compatibility with Linux */
15 FILE *_stderr asm("stderr");
16 int *__errno_location;
17 /* Will probably break everything, probably need to fetch from glibc */
18 void *__ctype_b_loc;
20 int main(int argc, char *argv[], char *envp[])
21 {
22 value *val;
24 /* Get current thread's value */
25 _stderr = stderr;
26 __errno_location = &errno;
28 printf("starting caml\n");
30 /* Wait before things might hang up */
31 sleep(1);
33 caml_startup(argv);
34 val = caml_named_value("main");
35 if (!val) {
36 printf("Couldn't find Caml main");
37 return 1;
38 }
39 caml_callback(*val, Val_int(0));
40 printf("callback returned\n");
41 return 0;
42 }