Ignore:
Timestamp:
2013-01-11T00:34:32Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eb1d9c1
Parents:
b9f72b97
Message:

arm32: Add Security extensions basics.

No monitor call handling, just checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/security_ext.h

    rb9f72b97 r7e87436  
    4949}
    5050
     51static inline bool sec_ext_is_monitor_mode()
     52{
     53        return (current_status_reg_read() & MODE_MASK) == MONITOR_MODE;
     54}
     55
    5156static inline bool sec_ext_is_secure()
    5257{
    5358        return sec_ext_is_implemented()
    54             && ((current_status_reg_read() & MODE_MASK) == MONITOR_MODE
    55                 || !(SCR_read() & SCR_NS_FLAG));
     59            && (sec_ext_is_monitor_mode() || !(SCR_read() & SCR_NS_FLAG));
    5660}
     61
     62typedef enum {
     63        SECURITY_CALL_ENABLE_CP10_11 = 0xaaaa
     64} sec_ext_call_t;
     65
     66static inline void sec_ext_call(sec_ext_call_t call)
     67{
     68        asm volatile ("mov r0, %0\nsmc #0" ::"r"(call));
     69}
     70
     71int sec_ext_handle_call(sec_ext_call_t call);
    5772
    5873#endif
Note: See TracChangeset for help on using the changeset viewer.