2024-01-21 08:22:06 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "threadpool.h"
|
|
|
|
|
2024-01-22 14:02:59 +01:00
|
|
|
#include "timer.h"
|
2024-06-09 09:22:22 +02:00
|
|
|
|
2024-01-21 08:22:06 +01:00
|
|
|
#include "../kernel_interface/kernel_interface.h"
|
|
|
|
|
2024-06-09 09:22:22 +02:00
|
|
|
#include "../module.h"
|
|
|
|
|
2024-01-21 08:22:06 +01:00
|
|
|
namespace dispatcher {
|
|
|
|
|
2024-01-25 12:09:16 +01:00
|
|
|
constexpr int DISPATCH_LOOP_SLEEP_TIME = 30;
|
2024-02-14 17:16:27 +01:00
|
|
|
constexpr int KERNEL_DISPATCH_FUNCTION_COUNT = 12;
|
2024-01-25 12:09:16 +01:00
|
|
|
constexpr int DISPATCHER_THREAD_COUNT = 4;
|
|
|
|
constexpr int TIMER_CALLBACK_DELAY = 15;
|
|
|
|
constexpr int WRITE_SHARED_MAPPING_PERIOD = 30;
|
|
|
|
constexpr int WRITE_SHARED_MAPPING_DUE_TIME = 30;
|
2024-01-21 08:22:06 +01:00
|
|
|
|
|
|
|
class dispatcher {
|
2024-01-22 14:02:59 +01:00
|
|
|
timer timers;
|
2024-01-21 08:22:06 +01:00
|
|
|
thread_pool thread_pool;
|
|
|
|
kernel_interface::kernel_interface k_interface;
|
2024-06-09 09:22:22 +02:00
|
|
|
module::module_information *module_info;
|
2024-01-21 08:22:06 +01:00
|
|
|
|
|
|
|
void issue_kernel_job();
|
2024-01-25 12:09:16 +01:00
|
|
|
void write_shared_mapping_operation();
|
2024-01-22 14:02:59 +01:00
|
|
|
void init_timer_callbacks();
|
|
|
|
void run_timer_thread();
|
|
|
|
void run_io_port_thread();
|
2024-01-28 08:34:09 +01:00
|
|
|
void request_session_pk();
|
2024-01-21 08:22:06 +01:00
|
|
|
|
|
|
|
public:
|
2024-06-09 09:22:22 +02:00
|
|
|
dispatcher(LPCWSTR driver_name, client::message_queue &queue, module::module_information* module_info);
|
2024-01-21 08:22:06 +01:00
|
|
|
void run();
|
|
|
|
};
|
|
|
|
} // namespace dispatcher
|