History log of /freebsd-10-stable/sys/dev/ofw/openfirmio.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 194138 13-Jun-2009 marius

Fix style.


# 186347 19-Dec-2008 nwhitehorn

Modularize the Open Firmware client interface to allow run-time switching
of OFW access semantics, in order to allow future support for real-mode
OF access and flattened device frees. OF client interface modules are
implemented using KOBJ, in a similar way to the PPC PMAP modules.

Because we need Open Firmware to be available before mutexes can be used on
sparc64, changes are also included to allow KOBJ to be used very early in
the boot process by only using the mutex once we know it has been initialized.

Reviewed by: marius, grehan


# 161836 01-Sep-2006 marius

Fix spelling and wording in a comment.


# 139749 05-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


# 133862 16-Aug-2004 marius

Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by: tmm


# 130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


# 129587 22-May-2004 marius

- Move OFW_NAME_MAX, used as a limit for OFW property names and device
identifiers, to openfirmio.h as OFIOCMAXNAME, so programs can use it
for buffer sizes etc.
Note: Although this is only a rough upper limit to make the code more
robust and to prevent the allocation of ridiculous amounts of memory,
the current limit of one page (8191 + '\0' in openfirm_getstr()) still
appears a bit high. The maximum length of OFW property names is 31.
I didn't find a maximum length for the device identifiers in the OFW
documentation but it certainly is much smaller than 8191, too.
- Enable the OFIOCSET ioctl, i.e. move it out from under #if 0.
- Don't use openfirm_getstr() for the property value in OFIOCSET, there
are also properties whose values aren't strings and it makes sense to
use a different maximum length for property values than OFW_NAME_MAX/
OFIOCMAXNAME. The maximum accepted property value is defined in
openfirmio.h as OFIOCMAXVALUE (currently the maximum size of the value
of the nvramrc property).
- Make OFIOCSET not return EINVAL when OF_setprop() returns a different
length for the written value than it was told to write, this is normal
for the text string values of the properties in the OFW /options node.
Instead, only return EINVAL if OF_setprop() returned -1 (value could
not be written or property could not be created). Add a comment about
the specialty of the OFW /options node.
- Make OFIOCSET return the length of the written value returned by
OF_setprop(), just like OF_getprop() does. Quite useful, at least for
debugging.

Reviewed by: tmm


# 128019 07-Apr-2004 imp

Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson


# 126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


# 120506 27-Sep-2003 phk

The present defaults for the open and close for device drivers which
provide no methods does not make any sense, and is not used by any
driver.

It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.

Change the defaults to be nullopen() and nullclose() which simply
does nothing.

Remove explicit initializations to these from the drivers which
already used them.


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 116210 11-Jun-2003 tmm

- Add an OFIOCGETPROPLEN ioctl() to get the length of a property.
- Do not use a fixed major.
- Minor cleanups.


# 111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


# 111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


# 109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


# 105398 18-Oct-2002 tmm

Add a pseudo device which allows to access the OpenFirmware device tree
via ioctl()s. This was ported from NetBSD and adapted a bit to better
match our OpenFirmware support code.