summaryrefslogtreecommitdiff
path: root/Kernel/Arch/DeferredCallPool.h
blob: d7d6886c70278339a216aaa86b7071d1f17c09fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Copyright (c) 2020, Tom <tomut@yahoo.com>
 * Copyright (c) 2023, Timon Kruiper <timonkruiper@gmail.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <Kernel/Arch/DeferredCallEntry.h>

namespace Kernel {

class DeferredCallPool {
public:
    void init();
    void execute_pending();
    DeferredCallEntry* get_free();
    void return_to_pool(DeferredCallEntry*);
    void queue_entry(DeferredCallEntry*);

private:
    DeferredCallEntry* m_pending_deferred_calls; // in reverse order
    DeferredCallEntry* m_free_deferred_call_pool_entry;
    DeferredCallEntry m_deferred_call_pool[5];
};

}