mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
Kernel: Move deferred call code into separate DeferredCallPool class
This allows us to share this code between the x86_64 and aarch64 build.
This commit is contained in:
parent
1f68ac600c
commit
c31dc82b17
7 changed files with 154 additions and 105 deletions
28
Kernel/Arch/DeferredCallPool.h
Normal file
28
Kernel/Arch/DeferredCallPool.h
Normal file
|
@ -0,0 +1,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];
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue