librtas_src/librtas.h

Go to the documentation of this file.
00001 
00010 #ifndef _LIBRTAS_H_
00011 #define _LIBRTAS_H_
00012 
00013 #include <stdint.h>
00014 
00015 #define RTAS_KERNEL_INT -1001   /* No Kernel Interface to Firmware */
00016 #define RTAS_KERNEL_IMP -1002   /* No Kernel Implementation of Function */
00017 #define RTAS_PERM       -1003   /* Non-root caller */
00018 #define RTAS_NO_MEM     -1004   /* Out of heap memory */
00019 #define RTAS_NO_LOWMEM  -1005   /* Kernel out of low memory */
00020 #define RTAS_FREE_ERR   -1006   /* Attempt to free nonexistant rmo buffer */
00021 #define RTAS_TIMEOUT    -1007   /* RTAS delay exceeded specified timeout */
00022 #define RTAS_IO_ASSERT  -1098   /* Unexpected I/O Error */
00023 #define RTAS_UNKNOWN_OP -1099   /* No Firmware Implementation of Function */
00024 
00025 /* Adding a new RTAS call requires the following:
00026  * 1) A function prototype in librtas.h (this file) that roughly matches
00027  *    the RTAS call name.
00028  * 2) An implementation of the new function in common.c.  Use the existing
00029  *    ones as an example.
00030  * 3) A function pointer definition in struct rtas_operations in common.h.
00031  *    Prepend a "token" argument to the argument list.
00032  * 4) An implementation-specific version of the RTAS function, in 
00033  *    syscall_calls.c and/or procfs_calls.c.  Remember to add your new 
00034  *    function to the rtas_operations struct at the top of the file.
00035  */
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 extern int rtas_activate_firmware();
00042 extern int rtas_cfg_connector(char *workarea);
00043 extern int rtas_delay_timeout(uint64_t timeout_ms);
00044 extern int rtas_display_char(char c);
00045 extern int rtas_display_msg(char *buf);
00046 extern int rtas_errinjct(int etoken, int otoken, char *workarea);
00047 extern int rtas_errinjct_close(int otoken);
00048 extern int rtas_errinjct_open(int *otoken);
00049 extern int rtas_free_rmo_buffer(void *buf, uint32_t phys_addr, size_t size);
00050 extern int rtas_get_dynamic_sensor(int sensor, void *loc_code, int *state);
00051 extern int rtas_get_indices(int is_sensor, int type, char *workarea,
00052                                 size_t size, int start, int *next);
00053 extern int rtas_get_power_level(int powerdomain, int *level);
00054 extern int rtas_get_rmo_buffer(size_t size, void **buf, uint32_t *phys_addr);
00055 extern int rtas_get_sensor(int sensor, int index, int *state);
00056 extern int rtas_get_sysparm(unsigned int parameter, unsigned int length,
00057                                 char *data);
00058 extern int rtas_get_time(uint32_t *year, uint32_t *month, uint32_t *day,
00059                                 uint32_t *hour, uint32_t *min, uint32_t *sec, 
00060                                 uint32_t *nsec);
00061 extern int rtas_get_vpd(char *loc_code, char *workarea, size_t size, 
00062                                 unsigned int sequence, unsigned int *seq_next,
00063                                 unsigned int *bytes_ret);
00064 extern int rtas_lpar_perftools(int subfunc, char *workarea, 
00065                                 unsigned int length, unsigned int sequence, 
00066                                 unsigned int *seq_next);
00067 extern int rtas_platform_dump(uint64_t dump_tag, uint64_t sequence, 
00068                                 void *buffer, size_t length, 
00069                                 uint64_t *next_seq, uint64_t *bytes_ret);
00070 extern int rtas_read_slot_reset(uint32_t cfg_addr, uint64_t phbid, int *state, 
00071                                 int *eeh);
00072 extern int rtas_scan_log_dump(void *buffer, size_t length);
00073 extern int rtas_set_debug(int level);
00074 extern int rtas_set_dynamic_indicator(int indicator, int new_value,
00075                                 void *loc_code);
00076 extern int rtas_set_eeh_option(uint32_t cfg_addr, uint64_t phbid, 
00077                                 int function);
00078 extern int rtas_set_indicator(int indicator, int index, int new_value);
00079 extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
00080 extern int rtas_set_poweron_time(uint32_t year, uint32_t month, uint32_t day,
00081                                 uint32_t hour, uint32_t min, uint32_t sec, 
00082                                 uint32_t nsec);
00083 extern int rtas_set_sysparm(unsigned int parameter, char *data);
00084 extern int rtas_set_time(uint32_t year, uint32_t month, uint32_t day, 
00085                                 uint32_t hour, uint32_t min, uint32_t sec, 
00086                                 uint32_t nsec);
00087 
00088 #ifdef __cplusplus
00089 }
00090 #endif
00091         
00092 #endif /* _LIBRTAS_H_ */

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