Ignore:
Timestamp:
Mar 12, 2019, 1:37:38 PM (5 years ago)
Author:
alain
Message:

Fix several bugs to use the instruction MMU in kernel mode
in replacement of the instruction address extension register,
and remove the "kentry" segment.

This version is running on the tsar_generic_iob" platform.

One interesting bug: the cp0_ebase defining the kernel entry point
(for interrupts, exceptions and syscalls) must be initialized
early in kernel_init(), because the VFS initialisation done by
kernel_ini() uses RPCs, and RPCs uses Inter-Processor-Interrup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_busylock.h

    r619 r624  
    22 * remote_busylock.h: remote kernel busy-waiting lock definition.     
    33 *
    4  * Authors  Alain Greiner (2016,2017,2018)
     4 * Authors  Alain Greiner (2016,2017,2018,2019)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    3737 * higher level synchronisation objects, such as remote_queuelock and remote_rwlock.
    3838 *
    39  * WARNING: a thread cannot yield when it is owning a busylock (local or remote).
    40  *
    4139 * - To acquire the lock, we use a ticket policy to avoid starvation: the calling thread
    4240 *   makes an atomic increment on a "ticket" allocator, and keep polling the "current"
    4341 *   value  until current == ticket.
    4442 *
    45  * - To release the lock, the owner thread increments the "current" value,
    46  *   decrements its busylocks counter.
     43 * - To release the lock, the owner thread increments the "current" value.
    4744 *
    48  * - When a thread takes a busylock, it enters a critical section: the busylock_acquire()
     45 * - When a thread takes a busylock, it enters a critical section: the acquire()
    4946 *   function disables the IRQs, takes the lock, increments the thread busylocks counter,
    50  *    save the SR in the lock descriptor and returns.
     47 *   save the SR in the lock descriptor and returns.
    5148 *
    52  * - The busylock_release() function decrements the thread busylock counter,
    53  *   restores the SR to exit the critical section, and returns
     49 * - The release() function releases the lock, decrements the thread busylock
     50 *   counter, restores the SR to exit the critical section, and returns.
    5451 *
    55  * - If a thread owning a busylock (local or remote) tries to deschedule, the scheduler
    56  *   signals a kernel panic.
     52 * WARNING: a thread cannot yield when it is holding a busylock (local or remote).
     53 *
     54 * This rule is checked by all functions containing a thread_yield() AND by the scheduler,
     55 * thanks to the busylocks counter stored in the calling thread descriptor.
     56 * 1) all functions call "thread_assert_can_yield()" before calling "thread_yield()".
     57 * 2) The scheduler checks that the calling thread does not hold any busylock.
     58 * In case of violation the core goes to sleep after a [PANIC] message on TXT0.
    5759 ******************************************************************************************/
    5860
Note: See TracChangeset for help on using the changeset viewer.