Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/runtime/include/bibop.h
ViewVC logotype

View of /sml/trunk/runtime/include/bibop.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4313 - (download) (as text) (annotate)
Thu Sep 15 22:10:07 2016 UTC (3 years, 1 month ago) by jhr
File size: 1077 byte(s)
  Working on x86-64 (aka AMD64) support in runtime.  Still need to deal with
  the BIBOP in the GC.
/* bibop.h
 *
 * COPYRIGHT (c) 1994 AT&T Bell Laboratories.
 *
 * The BIBOP maps memory pages to page IDs.  The interpretation of most
 * of these IDs is defined by the GC (see ../gc/arena-id.h), but the
 * IDs for unmapped memory are defined here.
 *
 */

#ifndef _BIBOP_
#define _BIBOP_

typedef Unsigned16_t page_id_t;

#define PAGEID_unmapped	0xffff

#define isUNMAPPED(ID)	((ID) == PAGEID_unmapped)


/** The BIBOP **/

#ifdef TWO_LEVEL_MAP

#  error two level BIBOP mapping not implemented

typedef page_id_t **bibop_t;

#else

#define BIBOP_SHIFT		16		/* log2(BIBOP_PAGE_SZB) */
#define BIBOP_BITS		(BITS_PER_WORD-BIBOP_SHIFT)
#define BIBOP_SZ		(1<<BIBOP_BITS)
#define BIBOP_ADDR_TO_INDEX(a)	(((Addr_t)(a))>>BIBOP_SHIFT)

#define BIBOP_INDEX_TO_ADDR(i)	((Addr_t)((i) << BIBOP_SHIFT))
#define BIBOP_NBLKS_TO_SZB(i)	((Addr_t)((i) << BIBOP_SHIFT))

typedef page_id_t *bibop_t;

extern bibop_t        BIBOP;

#define ADDR_TO_PAGEID(bibop,a)		((bibop)[BIBOP_ADDR_TO_INDEX(a)])
#define INDEX_TO_PAGEID(bibop,a)	((bibop)[a])

#endif /* !TWO_LEVEL_MAP */

#endif /* !_BIBOP_ */

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0