Deleted Added
full compact
openfirm.c (208614) openfirm.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/dev/ofw/openfirm.c 208614 2010-05-28 10:43:56Z raj $");
59__FBSDID("$FreeBSD: head/sys/dev/ofw/openfirm.c 209801 2010-07-08 14:29:23Z nwhitehorn $");
60
61#include "opt_platform.h"
62
63#include <sys/param.h>
64#include <sys/kernel.h>
65#include <sys/malloc.h>
66#include <sys/systm.h>
67

--- 255 unchanged lines hidden (view full) ---

323
324#ifndef FDT
325/* Call the method in the scope of a given instance. */
326int
327OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns,
328 ...)
329{
330 va_list ap;
60
61#include "opt_platform.h"
62
63#include <sys/param.h>
64#include <sys/kernel.h>
65#include <sys/malloc.h>
66#include <sys/systm.h>
67

--- 255 unchanged lines hidden (view full) ---

323
324#ifndef FDT
325/* Call the method in the scope of a given instance. */
326int
327OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns,
328 ...)
329{
330 va_list ap;
331 unsigned long args_n_results[12];
331 cell_t args_n_results[12];
332 int n, status;
333
334 if (nargs > 6)
335 return (-1);
336 va_start(ap, nreturns);
337 for (n = 0; n < nargs; n++)
332 int n, status;
333
334 if (nargs > 6)
335 return (-1);
336 va_start(ap, nreturns);
337 for (n = 0; n < nargs; n++)
338 args_n_results[n] = va_arg(ap, unsigned long);
338 args_n_results[n] = va_arg(ap, cell_t);
339
340 status = OFW_CALL_METHOD(ofw_obj, instance, method, nargs, nreturns,
341 args_n_results);
342 if (status != 0)
343 return (status);
344
345 for (; n < nargs + nreturns; n++)
339
340 status = OFW_CALL_METHOD(ofw_obj, instance, method, nargs, nreturns,
341 args_n_results);
342 if (status != 0)
343 return (status);
344
345 for (; n < nargs + nreturns; n++)
346 *va_arg(ap, unsigned long *) = args_n_results[n];
346 *va_arg(ap, cell_t *) = args_n_results[n];
347 va_end(ap);
348 return (0);
349}
350
351/*
352 * Device I/O functions
353 */
354

--- 84 unchanged lines hidden ---
347 va_end(ap);
348 return (0);
349}
350
351/*
352 * Device I/O functions
353 */
354

--- 84 unchanged lines hidden ---