MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Emulator.hpp
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 as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef EMULATOR_H
19 #define EMULATOR_H
20 
21 //===========================================================================
22 //
23 // .DESCRIPTION
24 // This is the main fuction for the AXE VM emulator.
25 // It contains some global objects and a run method.
26 //
27 //===========================================================================
28 #include <kernel_types.h>
29 #include <TransporterRegistry.hpp>
30 
31 extern class JobTable globalJobTable;
32 extern class TimeQueue globalTimeQueue;
33 extern class FastScheduler globalScheduler;
34 extern class TransporterRegistry globalTransporterRegistry;
35 extern struct GlobalData globalData;
36 
37 #ifdef VM_TRACE
38 extern class SignalLoggerManager globalSignalLoggers;
39 #endif
40 
41 #ifndef NO_EMULATED_JAM
42 /* EMULATED_JAM_SIZE must be a power of two, so JAM_MASK will work. */
43 #define EMULATED_JAM_SIZE 1024
44 #define JAM_MASK (EMULATED_JAM_SIZE - 1)
45 
47  Uint32 theEmulatedJamIndex;
48  // last block entry, used in dumpJam() if jam contains no block entries
49  Uint32 theEmulatedJamBlockNumber;
50  Uint32 theEmulatedJam[EMULATED_JAM_SIZE];
51 };
52 #endif
53 
54 struct EmulatorData {
55  class Configuration * theConfiguration;
56  class WatchDog * theWatchDog;
57  class ThreadConfig * theThreadConfig;
58  class SimBlockList * theSimBlockList;
59  class SocketServer * m_socket_server;
60  class Ndbd_mem_manager * m_mem_manager;
61 
67  EmulatorData();
68 
72  void create();
73 
77  void destroy();
78 };
79 
80 extern struct EmulatorData globalEmulatorData;
81 
85 Uint32 compute_jb_pages(struct EmulatorData* ed);
86 
87 #endif