<commit_before>/// \file syscalls.c
/// \brief Sockpuppet API System Call functions
/// \defgroup SAPI Sockpuppet 
//! \addtogroup SAPI
//! @{
/// 
/// Sockpuppet API Code.  This is our
/// shim for Forth.  Should be very easy to port
/// to exotic environments.
///
/// These are all declared void because they return by modifying
/// the return stack.
///
/// Note that the official list/ordinality of syscalls is defined by svc.S
//
// Copyright(C) 2011-2014 <NAME>
//
//
// Change History.
// API Version 0203.  Add a return code to StreamPutChar for back-pressure.
// Re-organize the code to make it less machine specific.
#include <stdint.h>
#include "sapi.h"
#include "sapi-dylink.h"

// *******************************************************************
// MANDATORY CALLS
// *******************************************************************

/// @brief SVC 0: Return an API Version 
void __SAPI_00_Version(uint32_t *frame) {
	frame[0] = 0x0203;
	return;
	}

/// SVC 1: Return the address of the runtime link list
void __SAPI_01_GetLinkList(uint32_t *frame) {
        frame[0] = (uint32_t) dynamiclinks;
        }

// *******************************************************************
// Helper Functions
// *******************************************************************
/// While(1) loop for catching Reserved API Calls
void __SAPI_RFU(uint32_t *frame) {
	while(1) { ; }
	}

/// Catch Disabled API Calls, and return a nonsense value
/// This one was a hang loop, but its better to do something
/// harmless
/// @brief Return a bogus value for disabled calls.
void __SAPI_Disabled(uint32_t *frame) {
	frame[0] = 0xdead;
	frame[1] = 0xbeef;
	}<commit_msg>GetTimeMS is properly a core system call.<commit_after>/// \file syscalls.c
/// \brief Sockpuppet API System Call functions
/// \defgroup SAPI Sockpuppet 
//! \addtogroup SAPI
//! @{
/// 
/// Sockpuppet API Code.  This is our
/// shim for Forth.  Should be very easy to port
/// to exotic environments.
///
/// These are all declared void because they return by modifying
/// the return stack.
///
/// Note that the official list/ordinality of syscalls is defined by svc.S
//
// Copyright(C) 2011-2014 <NAME>
//
//
// Change History.
// API Version 0203.  Add a return code to StreamPutChar for back-pressure.
// Re-organize the code to make it less machine specific.
#include <stdint.h>
#include "sapi.h"
#include "sapi-dylink.h"

#ifndef MSCOUNTER 
#error You must define MSCOUNTER 
#endif

// *******************************************************************
// MANDATORY CALLS
// *******************************************************************

/// @brief SVC 0: Return an API Version 
void __SAPI_00_Version(uint32_t *frame) {
	frame[0] = 0x0203;
	return;
	}

/// SVC 1: Return the address of the runtime link list
void __SAPI_01_GetLinkList(uint32_t *frame) {
        frame[0] = (uint32_t) dynamiclinks;
        }

/// SVC 10: Return the current time.
void __SAPI_10_GetTimeMS(uint32_t *frame) {
	frame[0] = MSCOUNTER;
	}


// *******************************************************************
// Helper Functions
// *******************************************************************
/// While(1) loop for catching Reserved API Calls
void __SAPI_RFU(uint32_t *frame) {
	while(1) { ; }
	}

/// Catch Disabled API Calls, and return a nonsense value
/// This one was a hang loop, but its better to do something
/// harmless
/// @brief Return a bogus value for disabled calls.
void __SAPI_Disabled(uint32_t *frame) {
	frame[0] = 0xdead;
	frame[1] = 0xbeef;
	}
{'fraction_non_alphanumeric': 0.2593220338983051, 'fraction_numerical': 0.02514124293785311, 'mean_word_length': 3.5867875647668392, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '58535', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1066, 'n_words': 361}