1 /*
2 Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is also distributed with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have included with MySQL.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25 #ifndef BLOCK_NUMBERS_H
26 #define BLOCK_NUMBERS_H
27
28 #include <kernel_types.h>
29 #include <RefConvert.hpp>
30
31 /* 32768 */
32 #define MIN_API_BLOCK_NO 0x8000
33
34 /* 2047 */
35 #define API_PACKED 0x07ff
36
37 /* Fixed block numbers in API */
38 #define NO_API_FIXED_BLOCKS 2
39
40 /* 4002 */
41 #define API_CLUSTERMGR 0x0FA2
42 #define MGM_CONFIG_MAN 0x0FA3
43
44 #define MIN_API_FIXED_BLOCK_NO (API_CLUSTERMGR)
45 #define MAX_API_FIXED_BLOCK_NO (MIN_API_FIXED_BLOCK_NO + NO_API_FIXED_BLOCKS)
46
47
48 #define BACKUP 0xF4
49 #define DBTC 0xF5
50 #define DBDIH 0xF6
51 #define DBLQH 0xF7
52 #define DBACC 0xF8
53 #define DBTUP 0xF9
54 #define DBDICT 0xFA
55 #define NDBCNTR 0xFB
56 #define CNTR 0xFB
57 #define QMGR 0xFC
58 #define NDBFS 0xFD
59 #define CMVMI 0xFE
60 #define TRIX 0xFF
61 #define DBUTIL 0x100
62 #define SUMA 0x101
63 #define DBTUX 0x102
64 #define TSMAN 0x103
65 #define LGMAN 0x104
66 #define PGMAN 0x105
67 #define RESTORE 0x106
68 #define DBINFO 0x107
69 #define DBSPJ 0x108
70
71 const BlockReference BACKUP_REF = numberToRef(BACKUP, 0);
72 const BlockReference DBTC_REF = numberToRef(DBTC, 0);
73 const BlockReference DBDIH_REF = numberToRef(DBDIH, 0);
74 const BlockReference DBLQH_REF = numberToRef(DBLQH, 0);
75 const BlockReference DBACC_REF = numberToRef(DBACC, 0);
76 const BlockReference DBTUP_REF = numberToRef(DBTUP, 0);
77 const BlockReference DBDICT_REF = numberToRef(DBDICT, 0);
78 const BlockReference NDBCNTR_REF = numberToRef(NDBCNTR, 0);
79 const BlockReference QMGR_REF = numberToRef(QMGR, 0);
80 const BlockReference NDBFS_REF = numberToRef(NDBFS, 0);
81 const BlockReference CMVMI_REF = numberToRef(CMVMI, 0);
82 const BlockReference TRIX_REF = numberToRef(TRIX, 0);
83 const BlockReference DBUTIL_REF = numberToRef(DBUTIL, 0);
84 const BlockReference SUMA_REF = numberToRef(SUMA, 0);
85 const BlockReference DBTUX_REF = numberToRef(DBTUX, 0);
86 const BlockReference TSMAN_REF = numberToRef(TSMAN, 0);
87 const BlockReference LGMAN_REF = numberToRef(LGMAN, 0);
88 const BlockReference PGMAN_REF = numberToRef(PGMAN, 0);
89 const BlockReference RESTORE_REF = numberToRef(RESTORE, 0);
90 const BlockReference DBINFO_REF = numberToRef(DBINFO, 0);
91 const BlockReference DBSPJ_REF = numberToRef(DBSPJ, 0);
92
__hide_warnings_unused_ref_vars(void)93 static inline void __hide_warnings_unused_ref_vars(void) {
94 // Hide annoying warnings about unused variables
95 (void)BACKUP_REF; (void)DBTC_REF; (void)DBDIH_REF;
96 (void)DBLQH_REF; (void)DBACC_REF; (void)DBTUP_REF;
97 (void)DBDICT_REF; (void)NDBCNTR_REF; (void)QMGR_REF;
98 (void)NDBFS_REF; (void)CMVMI_REF; (void)TRIX_REF;
99 (void)DBUTIL_REF; (void)SUMA_REF; (void)DBTUX_REF;
100 (void)TSMAN_REF; (void)LGMAN_REF; (void)PGMAN_REF;
101 (void)RESTORE_REF; (void)DBINFO_REF; (void)DBSPJ_REF;
102 }
103
104 const BlockNumber MIN_BLOCK_NO = BACKUP;
105 const BlockNumber MAX_BLOCK_NO = DBSPJ;
106 const BlockNumber NO_OF_BLOCKS = (MAX_BLOCK_NO - MIN_BLOCK_NO + 1);
107
108 /**
109 * Used for printing and stuff
110 */
111 struct BlockName {
112 const char* name;
113 BlockNumber number;
114 };
115
116 extern const BlockName BlockNames[];
117 extern const BlockNumber NO_OF_BLOCK_NAMES;
118
119 #endif
120