ofw_real.c (208614) | ofw_real.c (209801) |
---|---|
1/* $NetBSD: Locore.c,v 1.7 2000/08/20 07:04:59 tsubai Exp $ */ 2 3/*- 4 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 5 * Copyright (C) 1995, 1996 TooLs GmbH. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 42 unchanged lines hidden (view full) --- 51 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 52 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 53 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 54 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 55 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 */ 57 58#include <sys/cdefs.h> | 1/* $NetBSD: Locore.c,v 1.7 2000/08/20 07:04:59 tsubai Exp $ */ 2 3/*- 4 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 5 * Copyright (C) 1995, 1996 TooLs GmbH. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 42 unchanged lines hidden (view full) --- 51 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 52 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 53 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 54 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 55 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 */ 57 58#include <sys/cdefs.h> |
59__FBSDID("$FreeBSD: head/sys/powerpc/ofw/ofw_real.c 208614 2010-05-28 10:43:56Z raj $"); | 59__FBSDID("$FreeBSD: head/sys/powerpc/ofw/ofw_real.c 209801 2010-07-08 14:29:23Z nwhitehorn $"); |
60 61#include <sys/param.h> 62#include <sys/kernel.h> 63#include <sys/lock.h> 64#include <sys/mutex.h> 65#include <sys/systm.h> 66 67#include <vm/vm.h> --- 24 unchanged lines hidden (view full) --- 92 const void *buf, size_t len); 93static ssize_t ofw_real_canon(ofw_t, const char *device, char *buf, size_t len); 94static phandle_t ofw_real_finddevice(ofw_t, const char *device); 95static ssize_t ofw_real_instance_to_path(ofw_t, ihandle_t instance, char *buf, 96 size_t len); 97static ssize_t ofw_real_package_to_path(ofw_t, phandle_t package, char *buf, 98 size_t len); 99static int ofw_real_call_method(ofw_t, ihandle_t instance, const char *method, | 60 61#include <sys/param.h> 62#include <sys/kernel.h> 63#include <sys/lock.h> 64#include <sys/mutex.h> 65#include <sys/systm.h> 66 67#include <vm/vm.h> --- 24 unchanged lines hidden (view full) --- 92 const void *buf, size_t len); 93static ssize_t ofw_real_canon(ofw_t, const char *device, char *buf, size_t len); 94static phandle_t ofw_real_finddevice(ofw_t, const char *device); 95static ssize_t ofw_real_instance_to_path(ofw_t, ihandle_t instance, char *buf, 96 size_t len); 97static ssize_t ofw_real_package_to_path(ofw_t, phandle_t package, char *buf, 98 size_t len); 99static int ofw_real_call_method(ofw_t, ihandle_t instance, const char *method, |
100 int nargs, int nreturns, unsigned long *args_and_returns); | 100 int nargs, int nreturns, cell_t *args_and_returns); |
101static ihandle_t ofw_real_open(ofw_t, const char *device); 102static void ofw_real_close(ofw_t, ihandle_t instance); 103static ssize_t ofw_real_read(ofw_t, ihandle_t instance, void *addr, size_t len); 104static ssize_t ofw_real_write(ofw_t, ihandle_t instance, const void *addr, 105 size_t len); 106static int ofw_real_seek(ofw_t, ihandle_t instance, u_int64_t pos); 107static caddr_t ofw_real_claim(ofw_t, void *virt, size_t size, u_int align); 108static void ofw_real_release(ofw_t, void *virt, size_t size); --- 538 unchanged lines hidden (view full) --- 647 648 ofw_real_stop(); 649 return (args.size); 650} 651 652/* Call the method in the scope of a given instance. */ 653static int 654ofw_real_call_method(ofw_t ofw, ihandle_t instance, const char *method, | 101static ihandle_t ofw_real_open(ofw_t, const char *device); 102static void ofw_real_close(ofw_t, ihandle_t instance); 103static ssize_t ofw_real_read(ofw_t, ihandle_t instance, void *addr, size_t len); 104static ssize_t ofw_real_write(ofw_t, ihandle_t instance, const void *addr, 105 size_t len); 106static int ofw_real_seek(ofw_t, ihandle_t instance, u_int64_t pos); 107static caddr_t ofw_real_claim(ofw_t, void *virt, size_t size, u_int align); 108static void ofw_real_release(ofw_t, void *virt, size_t size); --- 538 unchanged lines hidden (view full) --- 647 648 ofw_real_stop(); 649 return (args.size); 650} 651 652/* Call the method in the scope of a given instance. */ 653static int 654ofw_real_call_method(ofw_t ofw, ihandle_t instance, const char *method, |
655 int nargs, int nreturns, unsigned long *args_and_returns) | 655 int nargs, int nreturns, cell_t *args_and_returns) |
656{ 657 struct { 658 cell_t name; 659 cell_t nargs; 660 cell_t nreturns; 661 cell_t method; 662 cell_t instance; 663 cell_t args_n_results[12]; 664 } args = { 665 (cell_t)"call-method", 666 2, 667 1, 668 }; | 656{ 657 struct { 658 cell_t name; 659 cell_t nargs; 660 cell_t nreturns; 661 cell_t method; 662 cell_t instance; 663 cell_t args_n_results[12]; 664 } args = { 665 (cell_t)"call-method", 666 2, 667 1, 668 }; |
669 cell_t *cp; 670 unsigned long *ap; | 669 cell_t *cp, *ap; |
671 int n; 672 673 if (nargs > 6) 674 return (-1); 675 676 ofw_real_start(); 677 args.nargs = nargs + 2; 678 args.nreturns = nreturns + 1; --- 251 unchanged lines hidden --- | 670 int n; 671 672 if (nargs > 6) 673 return (-1); 674 675 ofw_real_start(); 676 args.nargs = nargs + 2; 677 args.nreturns = nreturns + 1; --- 251 unchanged lines hidden --- |