shithub: p9-stm32-example-os

ref: f801657f77f3923ec2388c25bdcb036c8019ba89
dir: /mem.h/

View raw version
/*	machine specific values	*/
/*	memory map

	static data		0x20000000-0x20001800
	mach			0x20001800-0x20002000
	dynamic data	0x20002000-0x20004800
	kstack			0x20004800-0x20005000
*/

#define MACHADDR	0x20001800UL

#define	DATASADDR	0x20002000UL
#define DATAEADDR	0x20005000UL
#define	DATASIZE	0x00002800UL

#define KSTKSIZE	2048
#define KSTACK		KSTKSIZE

/*	generic values	*/
#define HZ      	(24000)				/*! clock frequency */
#define	TK2MS(x)	((x)/(HZ/1000))
#define MS2HZ       (1000/HZ)			/*! millisec per clock tick */
#define TK2SEC(t)   ((t)/HZ)			/*! ticks to seconds */
#define MS2TK(t)    ((t)*(HZ/1000))		/*! milliseconds to ticks */

#define KiB             1024u       /*! Kibi 0x0000000000000400 */
#define MiB             1048576u    /*! Mebi 0x0000000000100000 */
#define GiB             1073741824u /*! Gibi 000000000040000000 */

#define KZERO           0x08000000          /*! kernel address space */
#define BY2PG           256                 /*! bytes per page */
#define BI2BY           8                   /*! bits per byte */
#define BI2WD           32                  /* bits per word */
#define BY2WD           4                   /* bytes per word */
#define BY2V            8                   /*! only used in xalloc.c and allocb.c */

// this  should be moved in _start
// #define KTZERO          (ROM_START + VEC_SIZE)  /* kernel text start */

#define ROUND(s,sz)     (((s)+(sz-1))&~(sz-1))
#define PGROUND(s)      ROUND(s, BY2PG)

#define MAXMACH         1

#define CACHELINESZ     32
#define BLOCKALIGN		32