Root/
Source at commit 1166 created 13 years 10 days ago. By meklort, Fixed recent Makefile changes. Please do not use /Users/evan/SourceCode/tmp/chameleon/trunk or VPATH. the *only* time you should use /Users/evan/SourceCode/tmp/chameleon/trunk is when setting the SRCROOT variable. Also note that very soon make pkg is going to be removed. The pkg build script in trunk is very out of date. Instead please use the package maker at http://forge.voodooprojects.org/p/chameleonApplications/. Once this is ready for trunk it will be merged. | |
---|---|
1 | /*␊ |
2 | * aml_generator.h␊ |
3 | * Chameleon␊ |
4 | *␊ |
5 | * Created by Mozodojo on 20/07/10.␊ |
6 | * Copyright 2010 mozo. All rights reserved.␊ |
7 | *␊ |
8 | */␊ |
9 | ␊ |
10 | #ifndef __LIBSAIO_AML_GENERATOR_H␊ |
11 | #define __LIBSAIO_AML_GENERATOR_H␊ |
12 | ␊ |
13 | #include "libsaio.h"␊ |
14 | #include "ACPIPatcher.h"␊ |
15 | ␊ |
16 | ␊ |
17 | #define␉AML_CHUNK_NONE␉␉0xff␊ |
18 | #define␉AML_CHUNK_ZERO␉␉0x00␊ |
19 | #define␉AML_CHUNK_ONE␉␉0x01␊ |
20 | #define␉AML_CHUNK_ALIAS␉␉0x06␊ |
21 | #define␉AML_CHUNK_NAME␉␉0x08␊ |
22 | #define␉AML_CHUNK_BYTE␉␉0x0A␊ |
23 | #define␉AML_CHUNK_WORD␉␉0x0B␊ |
24 | #define␉AML_CHUNK_DWORD␉␉0x0C␊ |
25 | #define␉AML_CHUNK_STRING␉0x0D␊ |
26 | #define␉AML_CHUNK_QWORD␉␉0x0E␊ |
27 | #define␉AML_CHUNK_SCOPE␉␉0x10␊ |
28 | #define␉AML_CHUNK_PACKAGE␉0x12␊ |
29 | ␊ |
30 | struct aml_chunk ␊ |
31 | {␊ |
32 | ␉unsigned char␉␉Type;␊ |
33 | ␉unsigned int␉␉Length;␊ |
34 | ␉char*␉␉␉␉Buffer;␊ |
35 | ␉␊ |
36 | ␉unsigned int␉␉Size;␊ |
37 | ␉␊ |
38 | ␉struct aml_chunk*␉Next;␊ |
39 | ␉struct aml_chunk*␉First;␊ |
40 | ␉struct aml_chunk*␉Last;␊ |
41 | };␊ |
42 | ␊ |
43 | static inline bool aml_isvalidchar(char c)␊ |
44 | {␊ |
45 | ␉return isupper(c) || isdigit(c) || c == '_';␊ |
46 | };␊ |
47 | ␊ |
48 | bool aml_add_to_parent(struct aml_chunk* parent, struct aml_chunk* node);␊ |
49 | struct aml_chunk* aml_create_node(struct aml_chunk* parent);␊ |
50 | void aml_destroy_node(struct aml_chunk* node);␊ |
51 | struct aml_chunk* aml_add_buffer(struct aml_chunk* parent, const char* buffer, unsigned int size);␊ |
52 | struct aml_chunk* aml_add_byte(struct aml_chunk* parent, unsigned char value);␊ |
53 | struct aml_chunk* aml_add_word(struct aml_chunk* parent, unsigned int value);␊ |
54 | struct aml_chunk* aml_add_dword(struct aml_chunk* parent, unsigned long value);␊ |
55 | struct aml_chunk* aml_add_qword(struct aml_chunk* parent, unsigned long long value);␊ |
56 | struct aml_chunk* aml_add_scope(struct aml_chunk* parent, const char* name);␊ |
57 | struct aml_chunk* aml_add_name(struct aml_chunk* parent, const char* name);␊ |
58 | struct aml_chunk* aml_add_package(struct aml_chunk* parent);␊ |
59 | struct aml_chunk* aml_add_alias(struct aml_chunk* parent, const char* name1, const char* name2);␊ |
60 | unsigned int aml_calculate_size(struct aml_chunk* node);␊ |
61 | unsigned int aml_write_node(struct aml_chunk* node, char* buffer, unsigned int offset);␊ |
62 | ␊ |
63 | #endif /* !__LIBSAIO_AML_GENERATOR_H */ |