X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fhal_proc.h;h=c80793444f3f9e80a88fadf60e52c6e2b9c466de;hb=c4af47e284ab94dc5e365b02f7d91e43f7880280;hp=fad225b8d9972393a4bada96edba1dcdcd470254;hpb=61c8b3334fb9bb3c1fb48d9f1f3508ffbe5341bf;p=tpg%2Facess2.git diff --git a/Kernel/include/hal_proc.h b/Kernel/include/hal_proc.h index fad225b8..c8079344 100644 --- a/Kernel/include/hal_proc.h +++ b/Kernel/include/hal_proc.h @@ -8,13 +8,39 @@ */ #ifndef _HAL_PROC_H_ #define _HAL_PROC_H_ +/** + * \file hal_proc.h + * \brief Achitecture defined thread/process management functions + */ #include +/** + * \brief Initialise the architecture dependent side of threading + */ extern void ArchThreads_Init(void); +/** + * \brief Start preemptive multithreading (if needed) + */ extern void Proc_Start(void); +/** + * \brief Get the ID of this CPU + * \return Zero based CPU ID + */ extern int GetCPUNum(void); +/** + * \brief Create a copy of the current process + * \param Flags Options for the clone + * \return ID of the new thread/process + */ extern tTID Proc_Clone(Uint Flags); +/** + * \brief Create a new kernel thread for the process + * \param Fnc Thread root function + * \param Ptr Argument to pass the root function + * \return ID of new thread + */ +extern tTID Proc_NewKThread( void (*Fnc)(void*), void *Ptr ); /** * \brief Start a user task * \param Entrypoint User entrypoint @@ -25,13 +51,29 @@ extern tTID Proc_Clone(Uint Flags); * \note This function should free \a ArgV */ extern void Proc_StartUser(Uint Entrypoint, Uint Base, int ArgC, char **ArgV, int DataSize) NORETURN; +/** + * \brief Call the fault handler for a thread + * \param Thread Thread that is at fault :) + */ extern void Proc_CallFaultHandler(tThread *Thread); +/** + * \brief Dump the CPU state for a thread + */ extern void Proc_DumpThreadCPUState(tThread *Thread); +/** + * \brief Select a new task and run it, suspending this + */ extern void Proc_Reschedule(void); - -extern tPAddr MM_ClearUser(void); +/** + * \brief Clear the user's memory space back to the minimum required to run + */ +extern void MM_ClearUser(void); +/** + * \brief Dump the address space to the debug channel + * \param Start First address + * \param End Last address + */ extern void MM_DumpTables(tVAddr Start, tVAddr End); - #endif