<commit_before>/**
 * @file syscall.h
 *
 * Copyright (C) 2005 IBM Corporation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * @author <NAME> <<EMAIL>>
 */

#ifndef _SYSCALL_H_
#define _SYSCALL_H_

#include <stdint.h>

/* Syscall number */
#ifndef __NR_rtas
#define __NR_rtas 255
#endif

#define MAX_ARGS 16

typedef uint32_t rtas_arg_t;

/* Based on include/asm-ppc64/rtas.h */
struct rtas_args {
	uint32_t token;
	uint32_t ninputs;
	uint32_t nret; 
	rtas_arg_t args[MAX_ARGS];
	rtas_arg_t *rets;     /* Pointer to return values in args[]. */
};  

struct region {
	uint64_t addr;
	uint32_t size;
	struct region *next;
};

extern int rtas_get_rmo_buffer(size_t size, void **buf, uint32_t *phys_addr);
extern int rtas_free_rmo_buffer(void *buf, uint32_t phys_addr, size_t size);
extern int interface_exists();
extern int read_entire_file(int fd, char **buf, size_t *len);
extern int rtas_token(const char *call_name);
extern int sanity_check(void);

#define BITS32_LO(_num) (uint32_t) (_num & 0xffffffffll)
#define BITS32_HI(_num) (uint32_t) (_num >> 32) 
#define BITS64(_high, _low) (uint64_t) (((uint64_t) _high << 32) | _low)

extern int dbg_lvl;

#define dbg(_fmt, _args...)						  \
	do {								  \
		if (dbg_lvl >= 0)					  \
			printf("librtas %s(): " _fmt, __func__, ##_args); \
	} while (0)

#endif<commit_msg>librtas: Do not enable debug message by default<commit_after>/**
 * @file syscall.h
 *
 * Copyright (C) 2005 IBM Corporation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * @author <NAME> <<EMAIL>>
 */

#ifndef _SYSCALL_H_
#define _SYSCALL_H_

#include <stdint.h>

/* Syscall number */
#ifndef __NR_rtas
#define __NR_rtas 255
#endif

#define MAX_ARGS 16

typedef uint32_t rtas_arg_t;

/* Based on include/asm-ppc64/rtas.h */
struct rtas_args {
	uint32_t token;
	uint32_t ninputs;
	uint32_t nret; 
	rtas_arg_t args[MAX_ARGS];
	rtas_arg_t *rets;     /* Pointer to return values in args[]. */
};  

struct region {
	uint64_t addr;
	uint32_t size;
	struct region *next;
};

extern int rtas_get_rmo_buffer(size_t size, void **buf, uint32_t *phys_addr);
extern int rtas_free_rmo_buffer(void *buf, uint32_t phys_addr, size_t size);
extern int interface_exists();
extern int read_entire_file(int fd, char **buf, size_t *len);
extern int rtas_token(const char *call_name);
extern int sanity_check(void);

#define BITS32_LO(_num) (uint32_t) (_num & 0xffffffffll)
#define BITS32_HI(_num) (uint32_t) (_num >> 32) 
#define BITS64(_high, _low) (uint64_t) (((uint64_t) _high << 32) | _low)

extern int dbg_lvl;

#define dbg(_fmt, _args...)						  \
	do {								  \
		if (dbg_lvl > 0)					  \
			printf("librtas %s(): " _fmt, __func__, ##_args); \
	} while (0)

#endif
{'fraction_non_alphanumeric': 0.10066290203780996, 'fraction_numerical': 0.02995335133808004, 'mean_word_length': 4.0925, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1510699', 'n_tokens_mistral': 1537, 'n_tokens_neox': 1382, 'n_words': 502}