[OSy] nejasnost v kodu

Maksym Kaban maksym.kaban at gmail.com
Wed Jan 10 13:35:49 CET 2007


Zdravim

Tusim ze je chyba v teto rutine. Nachazi se v arch/sys.S
Vsimnete si ze kdyz se ukladaji cp0 registry do bezpecneho mista,
posledni hodnota kterou nabyva $k0 je epc registr

Potom se na zaklade epc vytvori nova hodnota pro status registr misto
aby se vytvarela na zaklade puvodni hodnoty statusu

handle_general_exception:
        /*
         * Save registers that hold information about the exception to
a safe place.
         * We will need them later.
         */
        lui     $k1, (SAFE_PLACE) >> 16
        or      $k1, (SAFE_PLACE) & 0xffff

        mfc0    $k0, $context
        sw      $k0, OFFSET_SAFE_CONTEXT($k1)
        mfc0    $k0, $badvaddr
        sw      $k0, OFFSET_SAFE_BADVADDR($k1)
        mfc0    $k0, $entryhi
        sw      $k0, OFFSET_SAFE_ENTRYHI($k1)
        mfc0    $k0, $status
        sw      $k0, OFFSET_SAFE_STATUS($k1)
        mfc0    $k0, $cause
        sw      $k0, OFFSET_SAFE_CAUSE($k1)
        mfc0    $k0, $epc
        sw      $k0, OFFSET_SAFE_EPC($k1)

        /*
         * Leave exception level and disable interrupts. This is because we
         * need to store general registers on the stack frame which could
         * cause a TLB exception. A recursive exception call would overwrite
         * the return address and the kernel registers (k0, k1).
         */
        xor     $k1, $k1
        lui     $k1, 0xffff
        ori     $k1, $k1, 0xffc0 /* disable interrupts & leave
exception level */
        and     $k0, $k1
        mtc0    $k0, $status



More information about the NSWI004 mailing list