mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 10:27:12 +08:00
FDT(4): Port to RTEMS
This commit is contained in:
@@ -97,12 +97,18 @@ static ofw_method_t ofw_fdt_methods[] = {
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
#ifndef __rtems__
|
||||
static ofw_def_t ofw_fdt = {
|
||||
#else /* __rtems__ */
|
||||
ofw_def_t ofw_fdt = {
|
||||
#endif /* __rtems__ */
|
||||
OFW_FDT,
|
||||
ofw_fdt_methods,
|
||||
0
|
||||
};
|
||||
#ifndef __rtems__
|
||||
OFW_DEF(ofw_fdt);
|
||||
#endif /* __rtems__ */
|
||||
|
||||
static void *fdtp = NULL;
|
||||
|
||||
|
@@ -80,6 +80,9 @@ struct ofw_kobj {
|
||||
|
||||
typedef struct ofw_kobj *ofw_t;
|
||||
typedef struct kobj_class ofw_def_t;
|
||||
#ifdef __rtems__
|
||||
extern ofw_def_t ofw_fdt;
|
||||
#endif /* __rtems__ */
|
||||
|
||||
#define ofw_method_t kobj_method_t
|
||||
#define OFWMETHOD KOBJMETHOD
|
||||
|
@@ -84,7 +84,11 @@ MALLOC_DEFINE(M_OFWPROP, "openfirm", "Open Firmware properties");
|
||||
|
||||
static ihandle_t stdout;
|
||||
|
||||
#ifndef __rtems__
|
||||
static ofw_def_t *ofw_def_impl = NULL;
|
||||
#else /* __rtems__ */
|
||||
#define ofw_def_impl (&ofw_fdt)
|
||||
#endif /* __rtems__ */
|
||||
static ofw_t ofw_obj;
|
||||
static struct ofw_kobj ofw_kernel_obj;
|
||||
static struct kobj_ops ofw_kernel_kops;
|
||||
@@ -144,6 +148,10 @@ static void
|
||||
xrefinfo_init(void *unsed)
|
||||
{
|
||||
|
||||
#ifdef __rtems__
|
||||
if (OF_init(__DECONST(void *, bsp_fdt_get())) != 0)
|
||||
return (ENXIO);
|
||||
#endif /* __rtems__ */
|
||||
/*
|
||||
* There is no locking during this init because it runs much earlier
|
||||
* than any of the clients/consumers of the xref list data, but we do
|
||||
@@ -198,6 +206,7 @@ SET_DECLARE(ofw_set, ofw_def_t);
|
||||
boolean_t
|
||||
OF_install(char *name, int prio)
|
||||
{
|
||||
#ifndef __rtems__
|
||||
ofw_def_t *ofwp, **ofwpp;
|
||||
static int curr_prio = 0;
|
||||
|
||||
@@ -217,6 +226,9 @@ OF_install(char *name, int prio)
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
#else /* __rtems__ */
|
||||
return (TRUE);
|
||||
#endif /* __rtems__ */
|
||||
}
|
||||
|
||||
/* Initializer */
|
||||
|
Reference in New Issue
Block a user