Optimize session connection and buddy.

This commit is contained in:
TXuian
2024-04-24 14:31:00 +08:00
parent fc380de895
commit 213a92330e
8 changed files with 62 additions and 7 deletions
@@ -68,7 +68,6 @@ struct KFreeList {
struct double_list_node list_head;
};
#define MAX_NR_PAGES MAX_NR_FREE_PAGES
struct KBuddy {
uint32_t n_pages;
uint32_t use_lock;
@@ -77,7 +76,7 @@ struct KBuddy {
struct KPage* first_page;
uint32_t mem_start;
uint32_t mem_end;
struct KPage pages[MAX_NR_PAGES];
struct KPage* pages;
};
/*********************************************
@@ -89,6 +88,7 @@ struct KBuddy {
* @param mem_end free memory region end
* @return void
*/
bool KBuddyInit(struct KBuddy* pbuddy, uint32_t mem_start, uint32_t mem_end);
void KBuddySysInit(struct KBuddy* pbuddy, uint32_t mem_start, uint32_t mem_end);
/*
@@ -105,6 +105,8 @@ char* KBuddyAlloc(struct KBuddy* pbuddy, uint32_t size);
*/
bool KBuddyFree(struct KBuddy* pbuddy, char* vaddr);
void KBuddyDestory(struct KBuddy* pbuddy);
/*
* Print current free pages for debug.
*/
@@ -31,6 +31,7 @@ Modification:
#include "core.h"
#include "buddy.h"
#include "list.h"
#include "object_allocator.h"
#include "pagetable.h"
@@ -80,6 +81,7 @@ struct TaskMicroDescriptor {
/* task communication resources */
struct double_list_node cli_sess_listhead;
struct double_list_node svr_sess_listhead;
struct KBuddy* massive_ipc_allocator;
struct TraceTag server_identifier;
/* task schedule attributes */
@@ -98,6 +100,7 @@ struct SchedulerRightGroup {
struct XiziTaskManager {
struct double_list_node task_list_head[TASK_MAX_PRIORITY]; /* list of task control blocks that are allocated */
struct slab_allocator task_allocator;
struct slab_allocator task_buddy_allocator;
uint32_t next_pid;
/* init task manager */