+/*
+ * "__node_data" is used in the mips64 architecture,
+ * and "node_data" is used in other architectures.
+ */
+#ifndef __mips64
+#define NODE_DATA_VAR "node_data"
+#else
+#define NODE_DATA_VAR "__node_data"
+#endif
/*
- * Default -- look for type: struct pglist_data node_data[]
+ * Default -- look for type: node_data[]/__node_data[]
*/
if (LKCD_KERNTYPES()) {
- if (!kernel_symbol_exists("node_data"))
+ if (!kernel_symbol_exists(NODE_DATA_VAR))
goto pgdat2;
/*
- * Just index into node_data[] without checking that it is
- * an array; kerntypes have no such symbol information.
+ * Just index into node_data[]/__node_data[] without checking that
+ * it is an array; kerntypes have no such symbol information.
*/
} else {
- if (get_symbol_type("node_data", NULL, NULL) != TYPE_CODE_ARRAY)
+ if (get_symbol_type(NODE_DATA_VAR, NULL, NULL) != TYPE_CODE_ARRAY)
goto pgdat2;
open_tmpfile();
- sprintf(buf, "whatis node_data");
+ sprintf(buf, "whatis " NODE_DATA_VAR);
if (!gdb_pass_through(buf, fp, GNU_RETURN_ON_ERROR)) {
close_tmpfile();
goto pgdat2;
@@ -17848,14 +17857,15 @@ next_online_pgdat(int node)
close_tmpfile();
if ((!strstr(buf, "struct pglist_data *") &&
- !strstr(buf, "pg_data_t *")) ||
+ !strstr(buf, "pg_data_t *") &&
+ !strstr(buf, "struct node_data *")) ||
(count_chars(buf, '[') != 1) ||
(count_chars(buf, ']') != 1))
goto pgdat2;
}
- if (!readmem(symbol_value("node_data") + (node * sizeof(void *)),
- KVADDR, &pgdat, sizeof(void *), "node_data", RETURN_ON_ERROR) ||
+ if (!readmem(symbol_value(NODE_DATA_VAR) + (node * sizeof(void *)),
+ KVADDR, &pgdat, sizeof(void *), NODE_DATA_VAR, RETURN_ON_ERROR) ||
!IS_KVADDR(pgdat))
goto pgdat2;
@@ -17883,7 +17893,8 @@ pgdat2:
close_tmpfile();
if ((!strstr(buf, "struct pglist_data *") &&
- !strstr(buf, "pg_data_t *")) ||
+ !strstr(buf, "pg_data_t *") &&
+ !strstr(buf, "struct node_data *")) ||
(count_chars(buf, '[') != 1) ||
(count_chars(buf, ']') != 1))
goto pgdat3;
--
2.1.0