librtas_src/ofdt.c File Reference

#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "librtas.h"
#include "common.h"

Defines

#define BLOCK_SIZE   4096

Functions

static int open_prop_file (const char *prop_path, const char *prop_name, int *fd)
 Open the property name located at the specified property path.
static int get_property (const char *prop_path, const char *prop_name, char **prop_val, size_t *prop_len)
 Open a property file and read in its contents.
int rtas_token (const char *call_name)
 Retrive a rtas token for a given name.
int read_entire_file (int fd, char **buf, size_t *len)
 Read in an entire file into the supplied buffer.

Variables

static const char * ofdt_rtas_path = "/proc/device-tree/rtas"

Detailed Description

Copyright (C) 2005 IBM Corporation Common Public License Version 1.0 (see COPYRIGHT)

Author:
John Rose <johnrose@us.ibm.com>

Define Documentation

#define BLOCK_SIZE   4096


Function Documentation

static int get_property ( const char *  prop_path,
const char *  prop_name,
char **  prop_val,
size_t *  prop_len 
) [static]

get_property

Parameters:
prop_path path to the property file
prop_name propery name
prop_val 
prop_len 
Returns:
0 on success, !0 otherwise

static int open_prop_file ( const char *  prop_path,
const char *  prop_name,
int *  fd 
) [static]

open_prop_file

Parameters:
prop_path path to the property name
prop_name property name
fd reference to file descriptor
Returns:
0 on success, -1 on failure

int read_entire_file ( int  fd,
char **  buf,
size_t *  len 
)

read_entire_file

Parameters:
fd opened file descriptor for file to read
buf buffer to read file into
len variable to return amount read into buffer
Returns:
0 on success, !0 otherwise

int rtas_token ( const char *  call_name  ) 

rtas_token

Parameters:
call_name rtas name to retrieve token for
Returns:
0 on success, !0 otherwise


Variable Documentation

const char* ofdt_rtas_path = "/proc/device-tree/rtas" [static]


Generated on Sat Sep 22 08:52:51 2007 for librtas by  doxygen 1.5.3