* default.
*/
typedef enum {
- p2m_access_rwx = 0, /* The default access type when not used. */
- p2m_access_wx = 1,
- p2m_access_rx = 2,
- p2m_access_x = 3,
- p2m_access_rw = 4,
- p2m_access_w = 5,
- p2m_access_r = 6,
- p2m_access_n = 7, /* No access allowed. */
+ /* Code uses bottom three bits with bitmask semantics */
+ p2m_access_n = 0, /* No access allowed. */
+ p2m_access_r = 1 << 0,
+ p2m_access_w = 1 << 1,
+ p2m_access_x = 1 << 2,
+ p2m_access_rw = p2m_access_r | p2m_access_w,
+ p2m_access_rx = p2m_access_r | p2m_access_x,
+ p2m_access_wx = p2m_access_w | p2m_access_x,
+ p2m_access_rwx = p2m_access_r | p2m_access_w | p2m_access_x,
p2m_access_rx2rw = 8, /* Special: page goes from RX to RW on write */
p2m_access_n2rwx = 9, /* Special: page goes from N to RWX on access, *