kern_sysctl.c File Reference

#include <sys/kern_sysctl.h>
#include <ubixos/types.h>
#include <ubixos/endtask.h>
#include <ubixos/kpanic.h>
#include <ubixos/spinlock.h>
#include <sys/thread.h>
#include <lib/kprintf.h>
#include <lib/kmalloc.h>
#include <assert.h>
#include <string.h>

Go to the source code of this file.

Functions

int __sysctl (struct thread *td, struct sysctl_args *uap)
static void def_ctls ()
int kern_sysctl (struct thread *td, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen, size_t *retval, int flags)
int sysctl_add (int *name, int namelen, char *str_name, void *buf, int buf_size)
static struct sysctl_entrysysctl_find (int *, int)
int sysctl_init ()
 sysctl initialization routine

Variables

static struct sysctl_entryctls = 0x0
bool sysctl_enabled = FALSE


Function Documentation

int __sysctl ( struct thread td,
struct sysctl_args uap 
)

Definition at line 161 of file kern_sysctl.c.

References CTL_MAXNAME, EINVAL, kern_sysctl(), Master, memcpy(), sysctl_args::name, name, sysctl_args::namelen, sysctl_args::new, sysctl_args::newlen, sysctl_args::old, sysctl_args::oldlenp, spinLock(), and spinUnlock().

static void def_ctls (  )  [static]

This is a cheat for now it set ups some default CTL information

Definition at line 49 of file kern_sysctl.c.

References CTL_MAXNAME, name, and sysctl_add().

Referenced by sysctl_init().

int kern_sysctl ( struct thread td,
int *  name,
u_int  namelen,
void *  old,
size_t oldlenp,
int  inkernel,
void *  new,
size_t  newlen,
size_t retval,
int  flags 
)

Definition at line 187 of file kern_sysctl.c.

References _current, endTask(), taskStruct::id, kprintf(), memcpy(), sysctl_find(), thread::td_retval, sysctl_entry::val_len, and sysctl_entry::value.

Referenced by __sysctl().

int sysctl_add ( int *  name,
int  namelen,
char *  str_name,
void *  buf,
int  buf_size 
)

Definition at line 236 of file kern_sysctl.c.

References sysctl_entry::children, sysctl_entry::id, kmalloc(), kprintf(), memcpy(), sysctl_entry::name, sysctl_entry::next, sysctl_entry::prev, sprintf(), sysctl_find(), sysctl_entry::val_len, and sysctl_entry::value.

Referenced by def_ctls().

static struct sysctl_entry * sysctl_find ( int *  ,
int   
) [static]

Definition at line 215 of file kern_sysctl.c.

References sysctl_entry::children, ctls, sysctl_entry::id, and sysctl_entry::next.

Referenced by kern_sysctl(), and sysctl_add().

int sysctl_init (  ) 

sysctl initialization routine

This routine initializes the top level ctl information

Temporary place for setting up default ctls

Definition at line 72 of file kern_sysctl.c.

References sysctl_entry::children, CTL_DEBUG, CTL_HW, CTL_KERN, CTL_MACHDEP, CTL_NET, CTL_P1003_1B, CTL_UBIX, CTL_UNSPEC, CTL_USER, CTL_VFS, CTL_VM, ctls, def_ctls(), sysctl_entry::id, K_PANIC, kmalloc(), sysctl_entry::name, sysctl_entry::next, sysctl_entry::prev, sprintf(), sysctl_enabled, and TRUE.


Variable Documentation

struct sysctl_entry* ctls = 0x0 [static]

Definition at line 41 of file kern_sysctl.c.

Referenced by sysctl_find(), and sysctl_init().

bool sysctl_enabled = FALSE

Definition at line 44 of file kern_sysctl.c.

Referenced by sysctl_init(), and vmmFindFreePage().


Generated on Sun Dec 3 02:38:09 2006 for UbixOS V2 by  doxygen 1.4.7