void Module::initialiseGHS() { *p__gh_errno = 0; *p__gh_FOPEN_MAX = GHS_FOPEN_MAX; *p_environEmpty = nullptr; *p_environ = p_environEmpty; OSInitSpinLock(ghsSpinLock); // This is actually meant to be during _crt_startup p_iob[0]->info = static_cast<_ghs_iobuf_bits>(p_iob[0]->info) .readable(true) .channel(0); p_iob[1]->info = static_cast<_ghs_iobuf_bits>(p_iob[1]->info) .writable(true) .channel(1); p_iob[2]->info = static_cast<_ghs_iobuf_bits>(p_iob[2]->info) .writable(true) .channel(2); ghs_flock_create(p_iob_lock[0]); ghs_flock_create(p_iob_lock[1]); ghs_flock_create(p_iob_lock[2]); kernel::loader::setSyscallAddress(sSyscallFunc); }
void CoreInit::initialiseGHS() { *p__gh_FOPEN_MAX = GHS_FOPEN_MAX; ghsSpinLock = OSAllocFromSystem<OSSpinLock>(); OSInitSpinLock(ghsSpinLock); }
void MEMiInitHeapHead(CommonHeap *heap, HeapType type, uint32_t dataStart, uint32_t dataEnd) { heap->tag = type; MEMInitList(&heap->list, offsetof(CommonHeap, link)); heap->dataStart = dataStart; heap->dataEnd = dataEnd; OSInitSpinLock(&heap->lock); heap->flags = 0; if (auto list = findListContainingHeap(heap)) { MEMAppendListObject(list, heap); } }
/** * Initialise a task queue structure. */ void MPInitTaskQ(MPTaskQueue *queue, be_ptr<MPTask> *taskBuffer, uint32_t taskBufferLen) { OSInitSpinLock(&queue->lock); queue->self = queue; queue->state = MPTaskQueueState::Initialised; queue->tasks = 0; queue->tasksReady = 0; queue->tasksRunning = 0; queue->tasksFinished = 0; queue->queueIndex = 0; queue->queueSize = 0; queue->queue = taskBuffer; queue->queueMaxSize = taskBufferLen; }
void CoreInit::initialiseGHS() { ghsSpinLock = OSAllocFromSystem<OSSpinLock>(); OSInitSpinLock(ghsSpinLock); }