Deleted Added
full compact
acpi_package.c (150003) acpi_package.c (165875)
1/*-
2 * Copyright (c) 2003 Nate Lawson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003 Nate Lawson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_package.c 150003 2005-09-11 18:39:03Z obrien $");
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_package.c 165875 2007-01-07 21:53:42Z njl $");
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/bus.h>
33#include <sys/sbuf.h>
34
35#include <machine/bus.h>
36#include <machine/resource.h>

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

99 return (E2BIG);
100
101 strlcpy(dst, ptr, length);
102 return (0);
103}
104
105int
106acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *type, int *rid,
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/bus.h>
33#include <sys/sbuf.h>
34
35#include <machine/bus.h>
36#include <machine/resource.h>

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

99 return (E2BIG);
100
101 strlcpy(dst, ptr, length);
102 return (0);
103}
104
105int
106acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *type, int *rid,
107 struct resource **dst)
107 struct resource **dst, u_int flags)
108{
109 ACPI_GENERIC_ADDRESS gas;
110 ACPI_OBJECT *obj;
111
112 obj = &res->Package.Elements[idx];
113 if (obj == NULL || obj->Type != ACPI_TYPE_BUFFER ||
114 obj->Buffer.Length < sizeof(ACPI_GENERIC_ADDRESS) + 3)
115 return (EINVAL);
116
117 memcpy(&gas, obj->Buffer.Pointer + 3, sizeof(gas));
118
108{
109 ACPI_GENERIC_ADDRESS gas;
110 ACPI_OBJECT *obj;
111
112 obj = &res->Package.Elements[idx];
113 if (obj == NULL || obj->Type != ACPI_TYPE_BUFFER ||
114 obj->Buffer.Length < sizeof(ACPI_GENERIC_ADDRESS) + 3)
115 return (EINVAL);
116
117 memcpy(&gas, obj->Buffer.Pointer + 3, sizeof(gas));
118
119 return (acpi_bus_alloc_gas(dev, type, rid, &gas, dst));
119 return (acpi_bus_alloc_gas(dev, type, rid, &gas, dst, flags));
120}
121
122ACPI_HANDLE
123acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj)
124{
125 ACPI_HANDLE h;
126
127 if (obj == NULL)

--- 24 unchanged lines hidden ---
120}
121
122ACPI_HANDLE
123acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj)
124{
125 ACPI_HANDLE h;
126
127 if (obj == NULL)

--- 24 unchanged lines hidden ---