PERFORCE change 153262 for review

Nathan Whitehorn nwhitehorn at FreeBSD.org
Thu Nov 20 07:58:29 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=153262

Change 153262 by nwhitehorn at nwhitehorn_trantor on 2008/11/20 15:57:47

	A few style(9) upgrades and a few changes to OF client interface
	argument types to do things like use size_t for bytecounts.

Affected files ...

.. //depot/projects/ppc-g5/sys/dev/ofw/ofw_if.m#2 edit
.. //depot/projects/ppc-g5/sys/dev/ofw/ofw_standard.c#2 edit
.. //depot/projects/ppc-g5/sys/dev/ofw/openfirm.c#4 edit
.. //depot/projects/ppc-g5/sys/dev/ofw/openfirm.h#5 edit
.. //depot/projects/ppc-g5/sys/powerpc/ofw/ofw_real.c#2 edit

Differences ...

==== //depot/projects/ppc-g5/sys/dev/ofw/ofw_if.m#2 (text+ko) ====

@@ -294,7 +294,7 @@
 METHOD ssize_t write {
 	ofw_t		_ofw;
 	ihandle_t	_instance;
-	void		*_buf;
+	const void	*_buf;
 	size_t		size;
 }
 
@@ -307,7 +307,7 @@
 METHOD int seek {
 	ofw_t		_ofw;
 	ihandle_t	_instance;
-	u_quad_t	_off;
+	uint64_t	_off;
 }
 
 # Open Firmware memory management
@@ -323,7 +323,7 @@
 	ofw_t		_ofw;
 	void		*_addr;
 	size_t		_size;
-	int		_align;
+	u_int		_align;
 }
 
 /**

==== //depot/projects/ppc-g5/sys/dev/ofw/ofw_standard.c#2 (text+ko) ====

@@ -97,7 +97,8 @@
 static ihandle_t ofw_std_open(ofw_t, const char *device);
 static void ofw_std_close(ofw_t, ihandle_t instance);
 static ssize_t ofw_std_read(ofw_t, ihandle_t instance, void *addr, size_t len);
-static ssize_t ofw_std_write(ofw_t, ihandle_t instance, void *addr, size_t len);
+static ssize_t ofw_std_write(ofw_t, ihandle_t instance, const void *addr, 
+    size_t len);
 static int ofw_std_seek(ofw_t, ihandle_t instance, u_int64_t pos);
 static caddr_t ofw_std_claim(ofw_t, void *virt, size_t size, u_int align);
 static void ofw_std_release(ofw_t, void *virt, size_t size);
@@ -621,7 +622,7 @@
 
 /* Write to an instance. */
 static ssize_t
-ofw_std_write(ofw_t ofw, ihandle_t instance, void *addr, size_t len)
+ofw_std_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len)
 {
 	static struct {
 		cell_t name;

==== //depot/projects/ppc-g5/sys/dev/ofw/openfirm.c#4 (text+ko) ====

@@ -339,14 +339,14 @@
 
 /* Write to an instance. */
 ssize_t
-OF_write(ihandle_t instance, void *addr, size_t len)
+OF_write(ihandle_t instance, const void *addr, size_t len)
 {
 	return (OFW_WRITE(ofw_obj, instance, addr, len));
 }
 
 /* Seek to a position. */
 int
-OF_seek(ihandle_t instance, u_int64_t pos)
+OF_seek(ihandle_t instance, uint64_t pos)
 {
 	return (OFW_SEEK(ofw_obj, instance, pos));
 }
@@ -357,14 +357,14 @@
 
 /* Claim an area of memory. */
 void *
-OF_claim(void *virt, u_int size, u_int align)
+OF_claim(void *virt, size_t size, u_int align)
 {
 	return (OFW_CLAIM(ofw_obj, virt, size, align));
 }
 
 /* Release an area of memory. */
 void
-OF_release(void *virt, u_int size)
+OF_release(void *virt, size_t size)
 {
 	OFW_RELEASE(ofw_obj, virt, size);
 }

==== //depot/projects/ppc-g5/sys/dev/ofw/openfirm.h#5 (text+ko) ====

@@ -60,6 +60,8 @@
 #ifndef _OPENFIRM_H_
 #define _OPENFIRM_H_
 
+#include <sys/types.h>
+
 /*
  * Prototypes for Open Firmware Interface Routines
  */
@@ -69,8 +71,6 @@
 typedef uint32_t	pcell_t;
 
 #ifdef _KERNEL
-#include <sys/cdefs.h>
-#include <sys/types.h>
 #include <sys/malloc.h>
 
 #include <machine/ofw_machdep.h>
@@ -81,6 +81,7 @@
  * Open Firmware interface initialization. OF_install installs the named
  * interface as the Open Firmware access mechanism, OF_init initializes it.
  */
+
 boolean_t	OF_install(char *name, int prio);
 void		OF_init(void *cookie);
 
@@ -97,33 +98,37 @@
 void		OF_printf(const char *, ...);
 
 /* Device tree functions */
-phandle_t	OF_peer(phandle_t);
-phandle_t	OF_child(phandle_t);
-phandle_t	OF_parent(phandle_t);
-phandle_t	OF_instance_to_package(ihandle_t);
-ssize_t		OF_getproplen(phandle_t, const char *);
-ssize_t		OF_getprop(phandle_t, const char *, void *, size_t);
-ssize_t		OF_getprop_alloc(phandle_t package, const char *propname, 
+phandle_t	OF_peer(phandle_t node);
+phandle_t	OF_child(phandle_t node);
+phandle_t	OF_parent(phandle_t node);
+ssize_t		OF_getproplen(phandle_t node, const char *propname);
+ssize_t		OF_getprop(phandle_t node, const char *propname, void *buf, 
+		    size_t len);
+ssize_t		OF_getprop_alloc(phandle_t node, const char *propname, 
 		    int elsz, void **buf);
-int		OF_nextprop(phandle_t, const char *name, char *, size_t);
-int		OF_setprop(phandle_t, const char *name, const void *, size_t);
-ssize_t		OF_canon(const char *, char *, size_t);
-phandle_t	OF_finddevice(const char *);
-ssize_t		OF_instance_to_path(ihandle_t, char *, size_t);
-ssize_t		OF_package_to_path(phandle_t, char *, size_t);
-int		OF_call_method(const char *, ihandle_t, int nargs, 
-		    int nreturns, ...);
+int		OF_nextprop(phandle_t node, const char *propname, char *buf, 
+		    size_t len);
+int		OF_setprop(phandle_t node, const char *name, const void *buf, 
+		    size_t len);
+ssize_t		OF_canon(const char *path, char *buf, size_t len);
+phandle_t	OF_finddevice(const char *path);
+ssize_t		OF_package_to_path(phandle_t node, char *buf, size_t len);
 
 /* Device I/O functions */
-ihandle_t	OF_open(const char *);
-void		OF_close(ihandle_t);
-ssize_t		OF_read(ihandle_t, void *, size_t);
-ssize_t		OF_write(ihandle_t, void *, size_t);
-int		OF_seek(ihandle_t, u_quad_t);
+ihandle_t	OF_open(const char *path);
+void		OF_close(ihandle_t instance);
+ssize_t		OF_read(ihandle_t instance, void *buf, size_t len);
+ssize_t		OF_write(ihandle_t instance, const void *buf, size_t len);
+int		OF_seek(ihandle_t instance, uint64_t where);
+
+phandle_t	OF_instance_to_package(ihandle_t instance);
+ssize_t		OF_instance_to_path(ihandle_t instance, char *buf, size_t len);
+int		OF_call_method(const char *method, ihandle_t instance, 
+		    int nargs, int nreturns, ...);
 
 /* Memory functions */
-void 		*OF_claim(void *, u_int, u_int);
-void		OF_release(void *, u_int);
+void 		*OF_claim(void *virtrequest, size_t size, u_int align);
+void		OF_release(void *virt, size_t size);
 
 /* Control transfer functions */
 void		OF_enter(void);

==== //depot/projects/ppc-g5/sys/powerpc/ofw/ofw_real.c#2 (text+ko) ====

@@ -102,7 +102,8 @@
 static ihandle_t ofw_real_open(ofw_t, const char *device);
 static void ofw_real_close(ofw_t, ihandle_t instance);
 static ssize_t ofw_real_read(ofw_t, ihandle_t instance, void *addr, size_t len);
-static ssize_t ofw_real_write(ofw_t, ihandle_t instance, void *addr, size_t len);
+static ssize_t ofw_real_write(ofw_t, ihandle_t instance, const void *addr, 
+    size_t len);
 static int ofw_real_seek(ofw_t, ihandle_t instance, u_int64_t pos);
 static caddr_t ofw_real_claim(ofw_t, void *virt, size_t size, u_int align);
 static void ofw_real_release(ofw_t, void *virt, size_t size);
@@ -732,7 +733,7 @@
 
 /* Write to an instance. */
 static ssize_t
-ofw_real_write(ofw_t ofw, ihandle_t instance, void *addr, size_t len)
+ofw_real_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len)
 {
 	static struct {
 		cell_t name;


More information about the p4-projects mailing list