XenevaOS
Loading...
Searching...
No Matches
Functions
clean.c File Reference
#include <aurora.h>
#include <clean.h>
#include <Drivers/uart.h>
#include <Mm/vmmngr.h>
#include <Mm/pmmngr.h>
#include <Mm/kmalloc.h>
Include dependency graph for clean.c:

Functions

void AuCleanMMap (AuProcess *proc)
 AuCleanMMap – clean default mmap addresses.
 
void AuCleanHeapMem (AuProcess *proc)
 AuCleanHeapMem – cleanup heap area of the process.
 
void AuCleanUserStack (AuProcess *proc, AuUserEntry *uentry)
 AuCleanUserStack – clean up given user stack.
 
void AuCleanKernelStack (AuProcess *proc, AA64Thread *thr)
 AuCleanKernelStack – clean up given kernel stack.
 
void AuProcessClean (AuProcess *parent, AuProcess *killable)
 AuProcessClean – clean up a process.
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ AuCleanHeapMem()

void AuCleanHeapMem ( AuProcess proc)

AuCleanHeapMem – cleanup heap area of the process.

Parameters
proc– Pointer to the killable process

◆ AuCleanKernelStack()

void AuCleanKernelStack ( AuProcess proc,
AA64Thread *  thr 
)

AuCleanKernelStack – clean up given kernel stack.

Parameters
proc– Pointer to killable process
thr– Pointer to thread that needs kernel stack cleanup

◆ AuCleanMMap()

void AuCleanMMap ( AuProcess proc)

AuCleanMMap – clean default mmap addresses.

Parameters
proc– Pointer to killable process

◆ AuCleanUserStack()

void AuCleanUserStack ( AuProcess proc,
AuUserEntry uentry 
)

AuCleanUserStack – clean up given user stack.

Parameters
proc– Pointer to killable process
uentry– Pointer to user entry data structure

◆ AuProcessClean()

void AuProcessClean ( AuProcess parent,
AuProcess killable 
)

AuProcessClean – clean up a process.

AuProcessClean – completely remove a process.

Parameters
parent– Pointer to parent process
killable– Killable process

first clean up process_mmap areas

clean up heap areas

clean up user allocated areas

free up each sub thread's user stack

free up the user stack

clean up the kernel stack of sub threads

free up the kernel stack of main thread

check for argument blocks

Check for additional argument block allocated for sub threads

free up environment block

free up uentry structs

free up uentry structs of sub threads

now free up thread data structures

clear up the process data structure