ia64/xen-unstable

view stubdom/caml/main-caml.c @ 18704:876618c33914

Define spin_barrier_irq() for IRQ-safe spinlocks, and use it for virq_lock.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Oct 22 15:06:01 2008 +0100 (2008-10-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 }