1/* 2 * Copyright 2007-2009 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef _FBSD_COMPAT_SYS_KERNEL_H_ 6#define _FBSD_COMPAT_SYS_KERNEL_H_ 7 8 9#include <stddef.h> 10#include <string.h> 11 12#include <sys/haiku-module.h> 13 14#include <sys/linker_set.h> 15#include <sys/queue.h> 16 17 18/* 19 * 20 * The rate at which FreeBSD can generate callouts (kind of timeout mechanism). 21 * For FreeBSD 8 this is typically 1000 times per second (100 for ARM). 22 * This value is defined in a file called subr_param.c 23 * 24 * WHile Haiku can have a much higher granularity, it is not a good idea to have 25 * this since FreeBSD tries to do certain tasks based on ticks, for instance 26 * autonegotiation and wlan scanning. 27 * Suffixing LL prevents integer overflows during calculations. 28 * as it defines a long long constant.*/ 29#define hz 1000LL 30 31#define ticks_to_usecs(t) (1000000*((bigtime_t)t) / hz) 32 33typedef void (*system_init_func_t)(void *); 34 35 36struct __system_init { 37 system_init_func_t func; 38}; 39 40/* TODO implement SYSINIT/SYSUNINIT subsystem */ 41#define SYSINIT(uniquifier, subsystem, order, func, ident) \ 42 struct __system_init __init_##uniquifier = { (system_init_func_t) func } 43 44#define SYSUNINIT(uniquifier, subsystem, order, func, ident) \ 45 struct __system_init __uninit_##uniquifier = { (system_init_func_t) func } 46 47#define TUNABLE_INT(path, var) 48#define TUNABLE_INT_FETCH(path, var) 49 50extern int ticks; 51 52#endif 53