<commit_before>/*
 * Copyright (c) 2011 <NAME> <<EMAIL>>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <mini-os/os.h>
#include <mini-os/sched.h>
#include <mini-os/events.h>

#include <caml/mlvalues.h>
#include <caml/memory.h>
#include <caml/callback.h>

void _exit(int);
int errno;
static char *argv[] = { "mirage", NULL };
static unsigned long irqflags;

/* XXX TODO: keep in sync with mirage-xen-minios */
void setup_xen_features(void);
void init_console(void);
void init_gnttab(void);

CAMLprim value
caml_block_domain(value v_until)
{
  CAMLparam1(v_until);
  block_domain((s_time_t)(Int64_val(v_until)));
  CAMLreturn(Val_unit);
}

void app_main_thread(void *unused)
{
  local_irq_save(irqflags);
  caml_startup(argv);
  _exit(0);
}

void start_kernel(void)
{
  /* Set up events. */
  init_events();

  /* Enable event delivery. This is disabled at start of day. */
  local_irq_enable();

  setup_xen_features();<commit_msg>xen-ocaml bindings: just include minios headers instead of forward decl<commit_after>/*
 * Copyright (c) 2011 <NAME> <<EMAIL>>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <mini-os/os.h>
#include <mini-os/sched.h>
#include <mini-os/events.h>
#include <mini-os/console.h>
#include <mini-os/gnttab.h>

#include <caml/mlvalues.h>
#include <caml/memory.h>
#include <caml/callback.h>

void _exit(int);
int errno;
static char *argv[] = { "mirage", NULL };
static unsigned long irqflags;

/* XXX TODO: keep in sync with mirage-xen-minios */
void setup_xen_features(void);

CAMLprim value
caml_block_domain(value v_until)
{
  CAMLparam1(v_until);
  block_domain((s_time_t)(Int64_val(v_until)));
  CAMLreturn(Val_unit);
}

void app_main_thread(void *unused)
{
  local_irq_save(irqflags);
  caml_startup(argv);
  _exit(0);
}

void start_kernel(void)
{
  /* Set up events. */
  init_events();

  /* Enable event delivery. This is disabled at start of day. */
  local_irq_enable();

  setup_xen_features();
{'fraction_non_alphanumeric': 0.10126582278481013, 'fraction_numerical': 0.004822182037371911, 'mean_word_length': 4.578151260504201, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7118358', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1045, 'n_words': 380}