Cleaned up src/lib/utils library. Renamed server_ functions to more logical
names. All system processes can now either use panic() or report() from libutils, or redefine their own function. Assertions are done via the standard <assert.h> functionality.
This commit is contained in:
@@ -17,20 +17,20 @@
|
||||
#include <ansi.h>
|
||||
|
||||
#include <minix/const.h>
|
||||
#include <minix/com.h>
|
||||
#include <minix/type.h>
|
||||
#include <minix/callnr.h>
|
||||
|
||||
#include <minix/ipc.h>
|
||||
|
||||
#define MM 0
|
||||
#define FS 1
|
||||
#define MM PM_PROC_NR
|
||||
#define FS FS_PROC_NR
|
||||
|
||||
_PROTOTYPE( int __execve, (const char *_path, char *const _argv[],
|
||||
char *const _envp[], int _nargs, int _nenvps) );
|
||||
_PROTOTYPE( int _syscall, (int _who, int _syscallnr, message *_msgptr) );
|
||||
_PROTOTYPE( void _loadname, (const char *_name, message *_msgptr) );
|
||||
_PROTOTYPE( int _len, (const char *_s) );
|
||||
_PROTOTYPE( void panic, (const char *_message, int _errnum) );
|
||||
_PROTOTYPE( void _begsig, (int _dummy) );
|
||||
|
||||
#endif /* _LIB_H */
|
||||
|
||||
@@ -176,18 +176,6 @@
|
||||
# define DL_BROAD_REQ 0x8
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* CLOCK request types and field names *
|
||||
*===========================================================================*/
|
||||
|
||||
/* Clock library calls are dispatched via a call vector, so be careful when
|
||||
* modifying the clock call numbers. The numbers here determine which call
|
||||
* is made from the call vector.
|
||||
*/
|
||||
# define CLK_SIGNALRM 1 /* clk_signalrm(proc_nr, ticks) */
|
||||
# define CLK_SYNCALRM 6 /* clk_syncalrm(proc_nr,exp_time,abs_time) */
|
||||
# define CLK_FLAGALRM 7 /* clk_flagalrm(ticks, flag_ptr) */
|
||||
|
||||
/*===========================================================================*
|
||||
* SYSTASK request types and field names *
|
||||
*===========================================================================*/
|
||||
@@ -213,7 +201,7 @@
|
||||
|
||||
# define SYS_SIGNALRM 15 /* sys_signalrm(proc_nr, ticks) */
|
||||
# define SYS_SYNCALRM 16 /* sys_syncalrm(proc_nr,exp_time,abs_time) */
|
||||
# define SYS_FLAGALRM 17 /* sys_flagalrm(ticks, flag_ptr) */
|
||||
|
||||
# define SYS_PHYSVCOPY 18 /* sys_physvcopy(vec_ptr, vec_size) */
|
||||
# define SYS_SVRCTL 19 /* sys_svrctl(proc_nr, req, argp) */
|
||||
# define SYS_SDEVIO 20 /* sys_sdevio(port, proc_nr, buf, count) */
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef __SERVERASSERT_H
|
||||
#define __SERVERASSERT_H
|
||||
|
||||
/* This file contains functions and macros used for debugging within
|
||||
* system servers. Also see <assert.h> which is used in regular programs.
|
||||
*/
|
||||
|
||||
#ifndef NDEBUG /* 8086 must do without training wheels. */
|
||||
#define NDEBUG (_WORD_SIZE == 2)
|
||||
#endif
|
||||
|
||||
#if !NDEBUG
|
||||
|
||||
#define INIT_SERVER_ASSERT static char *server_assert_file= __FILE__;
|
||||
|
||||
void server_assert_failed(char *file, int line, char *what);
|
||||
void server_compare_failed(char *file, int line, int lhs, char *what, int rhs);
|
||||
|
||||
#define server_assert(x) (!(x) ? server_assert_failed( \
|
||||
server_assert_file, __LINE__, #x) : (void) 0)
|
||||
#define server_compare(a,t,b) (!((a) t (b)) ? server_compare_failed( \
|
||||
server_assert_file, __LINE__, (a), #a " " #t " " #b, (b)) : (void) 0)
|
||||
|
||||
|
||||
#else /* NDEBUG */
|
||||
|
||||
#define INIT_SERVER_ASSERT /* nothing */
|
||||
|
||||
#define server_assert(x) (void) 0
|
||||
#define server_compare(a,t,b) (void) 0
|
||||
|
||||
#endif /* NDEBUG */
|
||||
|
||||
|
||||
#endif /* __SERVERASSERT_H */
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
* Mar 15, 2004 by Jorrit N. Herder
|
||||
*
|
||||
* Changes:
|
||||
* Mar 18, 2005: added tick_delay
|
||||
* May 31, 2005: added getuptime
|
||||
* Mar 18, 2005: added tickdelay
|
||||
* Mar 15, 2005: added get_proc_nr
|
||||
* Oct 01, 2004: added env_parse, env_prefix, env_panic
|
||||
* Jul 13, 2004: added fkey_ctl
|
||||
* Apr 28, 2004: added server_report, server_panic, server_assert
|
||||
* Apr 28, 2004: added report, panic
|
||||
* Mar 31, 2004: setup like other libraries, such as syslib
|
||||
*/
|
||||
|
||||
@@ -20,8 +21,6 @@
|
||||
* Miscellaneous helper functions.
|
||||
*==========================================================================*/
|
||||
|
||||
#include <minix/serverassert.h>
|
||||
|
||||
/* Environment parsing return values. */
|
||||
#define EP_BUF_SIZE 128 /* local buffer for env value */
|
||||
#define EP_UNSET 0 /* variable not set */
|
||||
@@ -40,13 +39,14 @@ _PROTOTYPE(int env_parse, (char *env, char *fmt, int field, long *param,
|
||||
#define fkey_disable(fkey) fkey_ctl(fkey, 0)
|
||||
_PROTOTYPE(int fkey_ctl, (int fkey_code, int enable_disable) );
|
||||
|
||||
_PROTOTYPE(void server_report, (char *who, char *mess, int num) );
|
||||
_PROTOTYPE(void server_panic, (char *who, char *mess, int num) );
|
||||
|
||||
_PROTOTYPE(int get_proc_nr, (int *proc_nr, char *proc_name) );
|
||||
|
||||
_PROTOTYPE(void report, (char *who, char *mess, int num));
|
||||
_PROTOTYPE(void panic, (char *who, char *mess, int num));
|
||||
|
||||
_PROTOTYPE(int getuptime, (clock_t *ticks));
|
||||
_PROTOTYPE(int tick_delay, (clock_t ticks));
|
||||
_PROTOTYPE(int tickdelay, (clock_t ticks));
|
||||
|
||||
#endif /* _EXTRALIB_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user