Skip to content

Commit

Permalink
Changed haskell kernel to match new fastpath homogenisation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
whalefur committed May 27, 2015
1 parent 4ccf65e commit 4625b65
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions haskell/src/SEL4/Kernel/VSpace/ARM.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ This helper function checks that the mapping installed at a given PT or PD slot
> _ -> throw InvalidRoot


> armv_contextSwitch_HWASID :: PPtr PDE -> HardwareASID -> Kernel ()
> armv_contextSwitch_HWASID pd hwasid = do
> doMachineOp $ setCurrentPD $ addrFromPPtr pd
> setHardwareASID hwasid

> armv_contextSwitch :: PPtr PDE -> ASID -> Kernel ()
> armv_contextSwitch pd asid = do
> doMachineOp $ setCurrentPD $ addrFromPPtr pd
Expand Down
10 changes: 8 additions & 2 deletions haskell/src/SEL4/Machine/Hardware/ARM.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,16 @@ caches must be done separately.

\subsubsection{Address Space Setup}

> writeTTBR0 :: PAddr -> MachineMonad ()
> writeTTBR0 pd = do
> cbptr <- ask
> liftIO $ Platform.writeTTBR0 cbptr pd

> setCurrentPD :: PAddr -> MachineMonad ()
> setCurrentPD pd = do
> cbptr <- ask
> liftIO $ Platform.setCurrentPD cbptr pd
> dsb
> writeTTBR0 pd
> isb

> setHardwareASID :: HardwareASID -> MachineMonad ()
> setHardwareASID (HardwareASID hw_asid) = do
Expand Down
2 changes: 1 addition & 1 deletion haskell/src/SEL4/Machine/Hardware/ARM/QEmu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ foreign import ccall unsafe "qemu_set_asid"
setHardwareASID :: Ptr CallbackData -> Word8 -> IO ()

foreign import ccall unsafe "qemu_set_root"
setCurrentPD :: Ptr CallbackData -> PAddr -> IO ()
writeTTBR0 :: Ptr CallbackData -> PAddr -> IO ()

foreign import ccall unsafe "qemu_arm_get_ifsr"
getIFSR :: Ptr CallbackData -> IO Word
Expand Down

0 comments on commit 4625b65

Please sign in to comment.