2013-04-05 14:06:58 +00:00
|
|
|
/* Copyright (C) 2011, 2012, 2013 The uOFW team
|
2012-09-14 19:39:02 +00:00
|
|
|
See the file COPYING for copying permission.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SYSMEM_COMMON_H
|
|
|
|
#define SYSMEM_COMMON_H
|
|
|
|
|
2013-01-05 23:52:05 +00:00
|
|
|
/* Not sure where this should be put */
|
|
|
|
|
|
|
|
/* Accepts addresses with 3 first bits: 000, 010, 100, 101 (first half byte 0x0, 0x1, 0x4, 0x5, 0x8, 0x9, 0xA, 0xB) */
|
2013-07-06 23:05:31 +00:00
|
|
|
#define VALID_ADDR_SEGMENT(addr) ((0x35 >> (((addr) >> 29) & 7)) & 1)
|
2013-01-05 23:52:05 +00:00
|
|
|
/* Accepts 0x10000 - 0x14000, with first bits as above */
|
2013-07-06 23:05:31 +00:00
|
|
|
#define ADDR_IS_SCRATCH(addr) ((((addr) >> 14) & 0x7FFF) == 4 && VALID_ADDR_SEGMENT(addr))
|
2013-01-05 23:52:05 +00:00
|
|
|
/* Accepts 0x04000000 - 0x047FFFFF, with first bits as above */
|
2013-07-06 23:05:31 +00:00
|
|
|
#define ADDR_IS_VRAM(addr) ((((addr) >> 23) & 0x3F) == 8 && VALID_ADDR_SEGMENT(addr))
|
2013-07-05 15:09:12 +00:00
|
|
|
/* Accepts 0x08000000 - 0x087FFFFFF, with first bits as above */
|
2013-07-06 23:05:31 +00:00
|
|
|
#define ADDR_IS_KERNEL_RAM(addr) (((((addr) >> 23) & 0x3F) != 0x10) && VALID_ADDR_SEGMENT(addr))
|
2013-01-05 23:52:05 +00:00
|
|
|
/* Accepts 0x08000000 - 0x0FFFFFFF, 0x48000000 - 0x4FFFFFFF, 0x88000000 - 0x8FFFFFFF and 0xA8000000 - 0xAFFFFFFF */
|
2013-07-06 23:05:31 +00:00
|
|
|
#define ADDR_IS_RAM(addr) ((0x00220202 >> (((addr) >> 27) & 0x1F)) & 1)
|
2013-01-05 23:52:05 +00:00
|
|
|
|
2012-09-14 19:39:02 +00:00
|
|
|
#endif
|
|
|
|
|