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

SCM Repository

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

Annotation of /sml/trunk/src/runtime/include/bibop.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 250 - (view) (download) (as text)

1 : monnier 249 /* bibop.h
2 :     *
3 :     * COPYRIGHT (c) 1994 AT&T Bell Laboratories.
4 :     *
5 :     * The BIBOP maps memory pages to page IDs. The interpretation of most
6 :     * of these IDs is defined by the GC (see ../gc/arena-id.h), but the
7 :     * IDs for unmapped memory are defined here.
8 :     *
9 :     */
10 :    
11 :     #ifndef _BIBOP_
12 :     #define _BIBOP_
13 :    
14 :     typedef Unsigned16_t page_id_t;
15 :    
16 :     #define PAGEID_unmapped 0xffff
17 :    
18 :     #define isUNMAPPED(ID) ((ID) == PAGEID_unmapped)
19 :    
20 :    
21 :     /** The BIBOP **/
22 :    
23 :     #ifdef TWO_LEVEL_MAP
24 :    
25 :     # error two level BIBOP mapping not implemented
26 :    
27 :     typedef page_id_t **bibop_t;
28 :    
29 :     #else
30 :    
31 :     #define BIBOP_SHIFT 16 /* log2(BIBOP_PAGE_SZB) */
32 :     #define BIBOP_BITS (BITS_PER_WORD-BIBOP_SHIFT)
33 :     #define BIBOP_SZ (1<<BIBOP_BITS)
34 :     #define BIBOP_ADDR_TO_INDEX(a) (((Addr_t)(a))>>BIBOP_SHIFT)
35 :    
36 :     #define BIBOP_INDEX_TO_ADDR(i) ((Addr_t)((i) << BIBOP_SHIFT))
37 :     #define BIBOP_NBLKS_TO_SZB(i) ((Addr_t)((i) << BIBOP_SHIFT))
38 :    
39 :     typedef page_id_t *bibop_t;
40 :    
41 :     extern bibop_t BIBOP;
42 :    
43 :     #define ADDR_TO_PAGEID(bibop,a) ((bibop)[BIBOP_ADDR_TO_INDEX(a)])
44 :    
45 :     #endif /* !TWO_LEVEL_MAP */
46 :    
47 :     #endif /* !_BIBOP_ */

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