OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 #define HMM_SYM_TO_STRING(X) #X | 38 #define HMM_SYM_TO_STRING(X) #X |
39 | 39 |
40 #ifndef HMM_CNFG_NUM | 40 #ifndef HMM_CNFG_NUM |
41 | 41 |
42 /* Default configuration. */ | 42 /* Default configuration. */ |
43 | 43 |
44 /* Use hmm_ prefix to avoid identifier conflicts. */ | 44 /* Use hmm_ prefix to avoid identifier conflicts. */ |
45 #define HMM_UNIQUE(BASE) hmm_ ## BASE | 45 #define HMM_UNIQUE(BASE) hmm_ ## BASE |
46 | 46 |
47 /* Number of bytes in an Address Alignment Unit (AAU). */ | 47 /* Number of bytes in an Address Alignment Unit (AAU). */ |
48 //fwg | 48 // fwg |
49 //#define HMM_ADDR_ALIGN_UNIT sizeof(int) | 49 // #define HMM_ADDR_ALIGN_UNIT sizeof(int) |
50 #define HMM_ADDR_ALIGN_UNIT 32 | 50 #define HMM_ADDR_ALIGN_UNIT 32 |
51 | 51 |
52 /* Number of AAUs in a Block Alignment Unit (BAU). */ | 52 /* Number of AAUs in a Block Alignment Unit (BAU). */ |
53 #define HMM_BLOCK_ALIGN_UNIT 1 | 53 #define HMM_BLOCK_ALIGN_UNIT 1 |
54 | 54 |
55 /* Type of unsigned integer big enough to hold the size of a Block in AAUs. */ | 55 /* Type of unsigned integer big enough to hold the size of a Block in AAUs. */ |
56 typedef unsigned long HMM_UNIQUE(size_aau); | 56 typedef unsigned long HMM_UNIQUE(size_aau); |
57 | 57 |
58 /* Type of unsigned integer big enough to hold the size of a Block/Chunk | 58 /* Type of unsigned integer big enough to hold the size of a Block/Chunk |
59 ** in BAUs. The high bit will be robbed. */ | 59 ** in BAUs. The high bit will be robbed. */ |
60 typedef unsigned long HMM_UNIQUE(size_bau); | 60 typedef unsigned long HMM_UNIQUE(size_bau); |
61 | 61 |
62 void hmm_dflt_abort(const char *, const char *); | 62 void hmm_dflt_abort(const char *, const char *); |
63 | 63 |
64 /* Actions upon a self-audit failure. Must expand to a single complete | 64 /* Actions upon a self-audit failure. Must expand to a single complete |
65 ** statement. If you remove the definition of this macro, no self-auditing | 65 ** statement. If you remove the definition of this macro, no self-auditing |
66 ** will be performed. */ | 66 ** will be performed. */ |
67 #define HMM_AUDIT_FAIL \ | 67 #define HMM_AUDIT_FAIL \ |
68 hmm_dflt_abort(__FILE__, HMM_SYM_TO_STRING(__LINE__)); | 68 hmm_dflt_abort(__FILE__, HMM_SYM_TO_STRING(__LINE__)); |
69 | 69 |
70 #elif HMM_CNFG_NUM == 0 | 70 #elif HMM_CNFG_NUM == 0 |
71 | 71 |
72 /* Definitions for testing. */ | 72 /* Definitions for testing. */ |
73 | 73 |
74 #define HMM_UNIQUE(BASE) thmm_ ## BASE | 74 #define HMM_UNIQUE(BASE) thmm_ ## BASE |
75 | 75 |
76 #define HMM_ADDR_ALIGN_UNIT sizeof(int) | 76 #define HMM_ADDR_ALIGN_UNIT sizeof(int) |
77 | 77 |
78 #define HMM_BLOCK_ALIGN_UNIT 3 | 78 #define HMM_BLOCK_ALIGN_UNIT 3 |
79 | 79 |
80 typedef unsigned HMM_UNIQUE(size_aau); | 80 typedef unsigned HMM_UNIQUE(size_aau); |
81 | 81 |
82 typedef unsigned short HMM_UNIQUE(size_bau); | 82 typedef unsigned short HMM_UNIQUE(size_bau); |
83 | 83 |
84 /* Under this test setup, a long jump is done if there is a self-audit | 84 /* Under this test setup, a long jump is done if there is a self-audit |
85 ** failure. | 85 ** failure. |
86 */ | 86 */ |
87 | 87 |
88 extern jmp_buf HMM_UNIQUE(jmp_buf); | 88 extern jmp_buf HMM_UNIQUE(jmp_buf); |
89 extern const char *HMM_UNIQUE(fail_file); | 89 extern const char *HMM_UNIQUE(fail_file); |
90 extern unsigned HMM_UNIQUE(fail_line); | 90 extern unsigned HMM_UNIQUE(fail_line); |
91 | 91 |
92 #define HMM_AUDIT_FAIL \ | 92 #define HMM_AUDIT_FAIL \ |
93 { HMM_UNIQUE(fail_file) = __FILE__; HMM_UNIQUE(fail_line) = __LINE__; \ | 93 { HMM_UNIQUE(fail_file) = __FILE__; HMM_UNIQUE(fail_line) = __LINE__; \ |
94 longjmp(HMM_UNIQUE(jmp_buf), 1); } | 94 longjmp(HMM_UNIQUE(jmp_buf), 1); } |
95 | 95 |
96 #elif HMM_CNFG_NUM == 1 | 96 #elif HMM_CNFG_NUM == 1 |
97 | 97 |
98 /* Put configuration 1 definitions here (if there is a configuration 1). */ | 98 /* Put configuration 1 definitions here (if there is a configuration 1). */ |
99 | 99 |
100 #elif HMM_CNFG_NUM == 2 | 100 #elif HMM_CNFG_NUM == 2 |
101 | 101 |
102 /* Put configuration 2 definitions here. */ | 102 /* Put configuration 2 definitions here. */ |
103 | 103 |
104 #elif HMM_CNFG_NUM == 3 | 104 #elif HMM_CNFG_NUM == 3 |
105 | 105 |
106 /* Put configuration 3 definitions here. */ | 106 /* Put configuration 3 definitions here. */ |
107 | 107 |
108 #elif HMM_CNFG_NUM == 4 | 108 #elif HMM_CNFG_NUM == 4 |
109 | 109 |
110 /* Put configuration 4 definitions here. */ | 110 /* Put configuration 4 definitions here. */ |
111 | 111 |
112 #elif HMM_CNFG_NUM == 5 | 112 #elif HMM_CNFG_NUM == 5 |
113 | 113 |
114 /* Put configuration 5 definitions here. */ | 114 /* Put configuration 5 definitions here. */ |
115 | 115 |
116 #endif | 116 #endif |
OLD | NEW |