1 1.3 joerg /* $NetBSD: aml_name.h,v 1.3 2011/07/17 20:54:55 joerg Exp $ */ 2 1.1 christos 3 1.1 christos /*- 4 1.1 christos * Copyright (c) 1999 Takanori Watanabe 5 1.1 christos * Copyright (c) 1999, 2000 Yasuo Yokoyama 6 1.1 christos * Copyright (c) 1999, 2000 Mitsuru IWASAKI <iwasaki (at) FreeBSD.org> 7 1.1 christos * All rights reserved. 8 1.1 christos * 9 1.1 christos * Redistribution and use in source and binary forms, with or without 10 1.1 christos * modification, are permitted provided that the following conditions 11 1.1 christos * are met: 12 1.1 christos * 1. Redistributions of source code must retain the above copyright 13 1.1 christos * notice, this list of conditions and the following disclaimer. 14 1.1 christos * 2. Redistributions in binary form must reproduce the above copyright 15 1.1 christos * notice, this list of conditions and the following disclaimer in the 16 1.1 christos * documentation and/or other materials provided with the distribution. 17 1.1 christos * 18 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 1.1 christos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 1.1 christos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 1.1 christos * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 1.1 christos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 1.1 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 1.1 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 1.1 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 1.1 christos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 1.1 christos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 1.1 christos * SUCH DAMAGE. 29 1.1 christos * 30 1.1 christos * Id: aml_name.h,v 1.17 2000/08/16 18:14:54 iwasaki Exp 31 1.1 christos * $FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_name.h,v 1.2 2000/11/09 06:24:45 iwasaki Exp $ 32 1.1 christos */ 33 1.1 christos 34 1.1 christos #ifndef _AML_NAME_H_ 35 1.1 christos #define _AML_NAME_H_ 36 1.1 christos 37 1.3 joerg #include <stdarg.h> 38 1.1 christos 39 1.1 christos #include <aml/aml_obj.h> 40 1.1 christos 41 1.1 christos struct aml_name { 42 1.1 christos char name[4]; 43 1.1 christos union aml_object *property; 44 1.1 christos struct aml_name *parent; 45 1.1 christos struct aml_name *brother; 46 1.1 christos struct aml_name *child; 47 1.1 christos struct aml_name *chain; 48 1.1 christos }; 49 1.1 christos 50 1.1 christos #define AML_NAME_GROUP_ROOT 0 51 1.1 christos #define AML_NAME_GROUP_OS_DEFINED 1 52 1.1 christos #define AML_NAME_GROUP_IN_METHOD 2 53 1.1 christos 54 1.1 christos struct aml_name_group { 55 1.2 dogcow void *id; /* DSDT address or DBHANDLE */ 56 1.1 christos struct aml_name *head; 57 1.1 christos struct aml_name_group *next; 58 1.1 christos }; 59 1.1 christos 60 1.1 christos struct aml_local_stack { 61 1.1 christos struct aml_name localvalue[8]; 62 1.1 christos struct aml_name argumentvalue[7]; 63 1.1 christos struct aml_name *temporary; 64 1.1 christos struct aml_local_stack *next; 65 1.1 christos }; 66 1.1 christos 67 1.1 christos /* forward declarement */ 68 1.1 christos struct aml_envrion; 69 1.1 christos 70 1.1 christos struct aml_name *aml_get_rootname(void); 71 1.2 dogcow struct aml_name_group *aml_new_name_group(void *); 72 1.1 christos void aml_delete_name_group(struct aml_name_group *); 73 1.1 christos 74 1.1 christos struct aml_name *aml_find_from_namespace(struct aml_name *, const char *); 75 1.1 christos void aml_apply_foreach_found_objects(struct aml_name *, 76 1.1 christos char *, int (*)(struct aml_name *, va_list), ...); 77 1.1 christos struct aml_name *aml_search_name(struct aml_environ *, const u_int8_t *); 78 1.1 christos struct aml_name *aml_create_name(struct aml_environ *, const u_int8_t *); 79 1.1 christos 80 1.1 christos struct aml_local_stack *aml_local_stack_create(void); 81 1.1 christos void aml_local_stack_push(struct aml_local_stack *); 82 1.1 christos struct aml_local_stack *aml_local_stack_pop(void); 83 1.1 christos void aml_local_stack_delete(struct aml_local_stack *); 84 1.1 christos struct aml_name *aml_local_stack_getLocalX(int); 85 1.1 christos struct aml_name *aml_local_stack_getArgX(struct aml_local_stack *, int); 86 1.1 christos struct aml_name *aml_create_local_object(void); 87 1.1 christos 88 1.1 christos extern struct aml_name_group *name_group_list; 89 1.1 christos 90 1.1 christos #endif /* !_AML_NAME_H_ */ 91