nvram.c File Reference

Implements the functions: nvramInit, nvramGet Functions to access the nvram settings from kernel space. More...

#include <kernel.h>
#include <memory.h>
#include <nvram.h>
#include <string.h>
#include <stdlib.h>

Include dependency graph for nvram.c:

Go to the source code of this file.

Functions

local nvramHash (char *p)
 Given an input string, this will calculate a simple hash between 0 and NVRAM_PAIRS-1 (inclusive).
local nvramInsert (struct nvram_tuple *tuple)
 Insert a tuple into the nvram_tuples table.
devcall nvramInit ()
 Initialize the nvram variable structures for editing.
char * nvramGet (char *name)
 Find the value of a variable.

Variables

struct nvram_headernvram_header = NULL
 header data for nvram
struct nvram_tuple * nvram_tuples [NVRAM_PAIRS]
 array of pointers to tuples


Detailed Description

Implements the functions: nvramInit, nvramGet Functions to access the nvram settings from kernel space.

Id
nvram.c 1485 2008-08-15 19:44:02Z brylow

Definition in file nvram.c.


Function Documentation

char* nvramGet ( char *  name  ) 

Find the value of a variable.

Parameters:
*name name of variable to find
Returns:
pointer to beginning of value

Definition at line 117 of file nvram.c.

References NULL, nvram_tuples, nvramHash(), nvramInit(), OK, and strlen().

Referenced by etherInit(), and xsh_nvram().

Here is the call graph for this function:

Here is the caller graph for this function:

local nvramHash ( char *  p  ) 

Given an input string, this will calculate a simple hash between 0 and NVRAM_PAIRS-1 (inclusive).

Parameters:
*p null or '=' terminated string
Returns:
value of hashed string

Definition at line 145 of file nvram.c.

References NVRAM_PAIRS.

Referenced by nvramGet(), and nvramInsert().

Here is the caller graph for this function:

devcall nvramInit ( void   ) 

Initialize the nvram variable structures for editing.

Returns:
OK on success, SYSERR on failure

Definition at line 26 of file nvram.c.

References memcpy(), memget(), NULL, nvram_header, NVRAM_LOCATION, NVRAM_MAGIC, NVRAM_PAIRS, nvram_tuples, nvramInsert(), OK, strlen(), and SYSERR.

Referenced by nvramGet(), sysinit(), and xsh_nvram().

Here is the call graph for this function:

Here is the caller graph for this function:

local nvramInsert ( struct nvram_tuple *  tuple  ) 

Insert a tuple into the nvram_tuples table.

Parameters:
*tuple pointer to tuple to add (should be memory address)
Returns:
OK on success

Definition at line 83 of file nvram.c.

References NULL, nvram_tuples, nvramHash(), and OK.

Referenced by nvramInit().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Wed Aug 27 06:08:56 2008 for Embedded XINU by  doxygen 1.5.5