1 /*
2    Copyright (c) 2003, 2016, 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 #define THRMAN     0x109
71 #define TRPMAN     0x10A
72 
73 const BlockReference BACKUP_REF  = numberToRef(BACKUP, 0);
74 const BlockReference DBTC_REF    = numberToRef(DBTC, 0);
75 const BlockReference DBDIH_REF   = numberToRef(DBDIH, 0);
76 const BlockReference DBLQH_REF   = numberToRef(DBLQH, 0);
77 const BlockReference DBACC_REF   = numberToRef(DBACC, 0);
78 const BlockReference DBTUP_REF   = numberToRef(DBTUP, 0);
79 const BlockReference DBDICT_REF  = numberToRef(DBDICT, 0);
80 const BlockReference NDBCNTR_REF = numberToRef(NDBCNTR, 0);
81 const BlockReference QMGR_REF    = numberToRef(QMGR, 0);
82 const BlockReference NDBFS_REF   = numberToRef(NDBFS, 0);
83 const BlockReference CMVMI_REF   = numberToRef(CMVMI, 0);
84 const BlockReference TRIX_REF    = numberToRef(TRIX, 0);
85 const BlockReference DBUTIL_REF  = numberToRef(DBUTIL, 0);
86 const BlockReference SUMA_REF    = numberToRef(SUMA, 0);
87 const BlockReference DBTUX_REF   = numberToRef(DBTUX, 0);
88 const BlockReference TSMAN_REF   = numberToRef(TSMAN, 0);
89 const BlockReference LGMAN_REF   = numberToRef(LGMAN, 0);
90 const BlockReference PGMAN_REF   = numberToRef(PGMAN, 0);
91 const BlockReference RESTORE_REF = numberToRef(RESTORE, 0);
92 const BlockReference DBINFO_REF  = numberToRef(DBINFO, 0);
93 const BlockReference DBSPJ_REF  = numberToRef(DBSPJ, 0);
94 const BlockReference THRMAN_REF  = numberToRef(THRMAN, 0);
95 const BlockReference TRPMAN_REF  = numberToRef(TRPMAN, 0);
96 
__hide_warnings_unused_ref_vars(void)97 static inline void __hide_warnings_unused_ref_vars(void) {
98   // Hide annoying warnings about unused variables
99   (void)BACKUP_REF;  (void)DBTC_REF;    (void)DBDIH_REF;
100   (void)DBLQH_REF;   (void)DBACC_REF;   (void)DBTUP_REF;
101   (void)DBDICT_REF;  (void)NDBCNTR_REF; (void)QMGR_REF;
102   (void)NDBFS_REF;   (void)CMVMI_REF;   (void)TRIX_REF;
103   (void)DBUTIL_REF;  (void)SUMA_REF;    (void)DBTUX_REF;
104   (void)TSMAN_REF;   (void)LGMAN_REF;   (void)PGMAN_REF;
105   (void)RESTORE_REF; (void)DBINFO_REF;  (void)DBSPJ_REF;
106   (void)THRMAN_REF;  (void)TRPMAN_REF;
107 }
108 
109 const BlockNumber MIN_BLOCK_NO = BACKUP;
110 const BlockNumber MAX_BLOCK_NO = TRPMAN;
111 const BlockNumber NO_OF_BLOCKS = (MAX_BLOCK_NO - MIN_BLOCK_NO + 1);
112 
113 #endif
114