Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150300941
D7411.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7411.diff
View Options
Index: head/sys/dev/fdt/fdt_common.h
===================================================================
--- head/sys/dev/fdt/fdt_common.h
+++ head/sys/dev/fdt/fdt_common.h
@@ -32,6 +32,7 @@
#ifndef _FDT_COMMON_H_
#define _FDT_COMMON_H_
+#include <sys/sysctl.h>
#include <sys/slicer.h>
#include <contrib/libfdt/libfdt_env.h>
#include <dev/ofw/ofw_bus.h>
@@ -80,6 +81,8 @@
extern u_char fdt_static_dtb;
#endif
+SYSCTL_DECL(_hw_fdt);
+
int fdt_addrsize_cells(phandle_t, int *, int *);
u_long fdt_data_get(void *, int);
int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *);
Index: head/sys/dev/fdt/fdt_common.c
===================================================================
--- head/sys/dev/fdt/fdt_common.c
+++ head/sys/dev/fdt/fdt_common.c
@@ -38,6 +38,7 @@
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/limits.h>
+#include <sys/sysctl.h>
#include <machine/resource.h>
@@ -60,6 +61,8 @@
#define FDT_REG_CELLS 4
+SYSCTL_NODE(_hw, OID_AUTO, fdt, CTLFLAG_RD, 0, "Flattened Device Tree");
+
vm_paddr_t fdt_immr_pa;
vm_offset_t fdt_immr_va;
vm_offset_t fdt_immr_size;
Index: head/sys/dev/ofw/ofw_fdt.c
===================================================================
--- head/sys/dev/ofw/ofw_fdt.c
+++ head/sys/dev/ofw/ofw_fdt.c
@@ -96,6 +96,27 @@
static void *fdtp = NULL;
static int
+sysctl_handle_dtb(SYSCTL_HANDLER_ARGS)
+{
+
+ return (sysctl_handle_opaque(oidp, fdtp, fdt_totalsize(fdtp), req));
+}
+
+static void
+sysctl_register_fdt_oid(void *arg)
+{
+
+ /* If there is no FDT registered, skip adding the sysctl */
+ if (fdtp == NULL)
+ return;
+
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_fdt), OID_AUTO, "dtb",
+ CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_handle_dtb, "",
+ "Device Tree Blob");
+}
+SYSINIT(dtb_oid, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_fdt_oid, 0);
+
+static int
ofw_fdt_init(ofw_t ofw, void *data)
{
int err;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 1, 12:45 AM (9 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30657761
Default Alt Text
D7411.diff (1 KB)
Attached To
Mode
D7411: Expose FDT blob via sysctl
Attached
Detach File
Event Timeline
Log In to Comment