ppc64-diag
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <time.h>
#include <librtas.h>
#include "rtas_errd.h"
Data Structures | |
struct | pmap_struct |
struct | drconf_cell |
Macros | |
#define | OFDT_BASE "/proc/device-tree" |
#define | OFDTPATH "/proc/ppc64/ofdt" |
#define | DRCONF_PATH "/proc/device-tree/ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory" |
Functions | |
static int | write_prrn_log (const char *buf, int len) |
static void | open_prrn_log (void) |
static void | close_prrn_log (void) |
uint32_t | get_drc_index (const char *path) |
static void | add_phandle_to_list (char *name, uint32_t phandle, uint32_t drc_index) |
static struct pmap_struct * | phandle_to_pms (uint32_t phandle) |
static int | add_std_phandles (char *parent, char *p) |
static int | add_drconf_phandles () |
static void | free_phandles () |
static int | add_phandles () |
static int | do_update (char *cmd, int len) |
static int | update_properties (uint32_t phandle) |
static void | do_node_update (struct pmap_struct *pms, const char *type) |
static void | update_nodes (unsigned int *op, unsigned int n) |
static void | devtree_update (uint scope) |
void | handle_prrn_event (struct event *re) |
Variables | |
static struct pmap_struct * | plist |
static int | prrn_log_fd |
static char | prrn_filename [128] |
Copyright (C) IBM Corporation
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define DRCONF_PATH "/proc/device-tree/ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory" |
Referenced by add_drconf_phandles().
#define OFDT_BASE "/proc/device-tree" |
Referenced by add_phandles(), and add_std_phandles().
#define OFDTPATH "/proc/ppc64/ofdt" |
Referenced by do_update().
|
static |
add_drconf_phandles
References add_phandle_to_list(), drconf_cell::drc_index, and DRCONF_PATH.
Referenced by add_phandles().
|
static |
add_phandle_to_list
name | |
phandle |
References pmap_struct::drc_index, pmap_struct::name, pmap_struct::next, pmap_struct::phandle, and plist.
Referenced by add_drconf_phandles(), and add_std_phandles().
|
static |
add_phandles
References add_drconf_phandles(), add_std_phandles(), free_phandles(), and OFDT_BASE.
Referenced by devtree_update().
|
static |
add_std_phandles
parent | |
p |
References add_phandle_to_list(), dbg, get_drc_index(), and OFDT_BASE.
Referenced by add_phandles().
|
static |
References prrn_log_fd.
Referenced by handle_prrn_event().
|
static |
devtree_update
References add_phandles(), dbg, free_phandles(), and update_nodes().
Referenced by handle_prrn_event().
|
static |
do_node_update
Not all nodes can be updated via a DLPAR operation, only those with a valid drc-index. For nodes without a drc-index we just update the prrn log file indicating that the node was updated in te device tree but that we cannot do a DLPAR operation.
type | |
pms |
References dbg, pmap_struct::drc_index, pmap_struct::name, pmap_struct::phandle, update_properties(), and write_prrn_log().
Referenced by update_nodes().
|
static |
|
static |
free_phandles
References pmap_struct::name, pmap_struct::next, and plist.
Referenced by add_phandles(), and devtree_update().
uint32_t get_drc_index | ( | const char * | path | ) |
References pmap_struct::drc_index.
Referenced by add_std_phandles().
void handle_prrn_event | ( | struct event * | re | ) |
References close_prrn_log(), dbg, devtree_update(), open_prrn_log(), prrn_filename, prrn_log_fd, and event::rtas_hdr.
Referenced by handle_rtas_event().
|
static |
References dbg, prrn_filename, and prrn_log_fd.
Referenced by handle_prrn_event().
|
static |
phandle_to_name
ph |
References pmap_struct::next, pmap_struct::phandle, and plist.
Referenced by update_nodes(), and update_properties().
|
static |
update_nodes
op | |
n |
References dbg, do_node_update(), pmap_struct::drc_index, pmap_struct::name, pmap_struct::phandle, phandle_to_pms(), and write_prrn_log().
Referenced by devtree_update().
|
static |
update_properties
phandle |
References dbg, do_update(), pmap_struct::name, and phandle_to_pms().
Referenced by do_node_update().
|
static |
References prrn_log_fd.
Referenced by do_node_update(), and update_nodes().
|
static |
Referenced by add_phandle_to_list(), free_phandles(), and phandle_to_pms().
|
static |
Referenced by handle_prrn_event(), and open_prrn_log().
|
static |
Referenced by close_prrn_log(), handle_prrn_event(), open_prrn_log(), and write_prrn_log().