#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" |
| #define BLOCK_SIZE 4096 |
Referenced by read_entire_file().
| static int get_property | ( | const char * | prop_path, | |
| const char * | prop_name, | |||
| char ** | prop_val, | |||
| size_t * | prop_len | |||
| ) | [static] |
get_property
| prop_path | path to the property file | |
| prop_name | propery name | |
| prop_val | ||
| prop_len |
References open_prop_file(), and read_entire_file().
Referenced by rtas_token().
| static int open_prop_file | ( | const char * | prop_path, | |
| const char * | prop_name, | |||
| int * | fd | |||
| ) | [static] |
open_prop_file
| prop_path | path to the property name | |
| prop_name | property name | |
| fd | reference to file descriptor |
Referenced by get_property().
| int read_entire_file | ( | int | fd, | |
| char ** | buf, | |||
| size_t * | len | |||
| ) |
read_entire_file
| fd | opened file descriptor for file to read | |
| buf | buffer to read file into | |
| len | variable to return amount read into buffer |
References BLOCK_SIZE, and dbg1.
Referenced by get_property(), and read_kregion_bounds().
| int rtas_token | ( | const char * | call_name | ) |
rtas_token
| call_name | rtas name to retrieve token for |
References get_property(), ofdt_rtas_path, and RTAS_UNKNOWN_OP.
const char* ofdt_rtas_path = "/proc/device-tree/rtas" [static] |
Referenced by rtas_token().
1.5.5