HP OpenVMS Systems Documentation

Content starts here

Upgrading Privileged-Code Applications on OpenVMS Alpha and OpenVMS I64 Systems


Previous Contents Index

7.5 OpenVMS Structure Fields

If you code references the PMM structure in the starlet libraries, please refer to Section 5.3 for a description of the new PMM64 structure available on Alpha and I64.

If your code references any of the following structure fields from the "lib" libraries, you must modify your code on I64 to reference the new field names. All new fields are added to OpenVMS on Alpha and I64 so that common code can be written.

Alpha Field Name (32 Bits) Alpha (32 Bits) and I64 (64 Bits)
gsd$l_basepfn gsd$i_basepfn
gsd$l_pages gsd$i_pages
gsd$l_refcnt gsd$i_refcnt
pmap$l_start_pfn pmap$i_start_pfn
pmap$l_pfn_count pmap$i_pfn_count
pfn$l_flink pfn$i_flink
pfn$l_blink pfn$i_blink
pfn$l_pt_pfn pfn$i_pt_pfn
pfn$l_color_flink pfn$i_color_flink
pfn$l_color_blink pfn$i_color_blink
prvpfn$l_head prvpfn$i_head
prvpfn$l_tail prvpfn$i_tail
rmd$l_first_pfn rmd$i_first_pfn
rmd$l_zero_pfn rmd$i_zero_pfn
prcstr$l_p1pointer_pfn prcstr$i_p1pointer_pfn
prcstr$l_pio_pfn prcstr$i_pio_pfn
mmap$l_first_pfn mmap$i_first_pfn
plnk$l_next_pfn plnk$i_next_pfn
plnk$l_pfn_count plnk$i_pfn_count
shm_cpp$l_min_pfn shm_cpp$i_min_pfn
shm_cpp$l_max_pfn shm_cpp$l_max_pfn
shm_cpp$l_recover_pfn shm_cpp$i_recover_pfn
smci$l_pfn smci$i_pfn

You must also examine all variables and code that reference the PFNs so that 64-bit PFNs are maintained.

Existing Code


    unsigned int first_pfn;     first_pfn = gsd->gsd$l_basepfn; 

New Code


    #include <lib_types.h>               /* Include PFN_T type */     PFN_T first_pfn;                    /* 32-bits on Alpha, 64-bits on I64 */     first_pfn = gsd->gsd$i_basepfn; 

7.6 System Data Cells

Some data cells in SYS$BASE_IMAGE.EXE describe PFNs. Data cells that describe PFNs are removed on I64. New data cells have been added to Alpha and I64. These data cells fall into a few categories that are described in the following sections.

7.6.1 Minimum and Maximum PFN Data Cells

If your code references any of the data cells in the following table, you must modify your code on I64 to reference the new cells:

Alpha Cell (32 Bits) New Alpha and I64 (64 Bit) Cell
MMG$GL_MINPFN MMG$GQ_MINPFN
MMG$GL_MAXPFN MMG$GQ_MAXPFN
MMG$GL_MAXMEM MMG$GQ_MAXMEM
MMG$GL_MIN_NODE_PFN MMG$GQ_MIN_NODE_PFN
MMG$GL_MAX_NODE_PFN MMG$GQ_MAX_NODE_PFN
MMG$GL_MIN_SHARED_PFN MMG$GQ_MIN_SHARED_PFN
MMG$GL_MAX_SHARED_PFN MMG$GQ_MAX_SHARED_PFN

You must examine all variables and code that reference the PFNs so that 64-bit PFNs are maintained.

Example


    extern const unsigned int mmg$gl_minpfn;     extern const unsigned int mmg$gl_maxpfn;     unsigned int test_pfn;     if ((mmg$gl_minpfn <= test_pfn) && (test_pfn <= mmg$gl_maxpfn)) 

New code


    extern const unsigned __int64 mmg$gq_minpfn;     extern const unsigned __int64 mmg$gq_maxpfn;     unsigned __int64 test_pfn;     if ((mmg$gq_minpfn <= test_pfn) && (test_pfn <= mmg$gq_maxpfn)) 

7.6.2 PFN List Arrays, Counts, and Limits

If your code references any of the data cells in the following tables, you must modify your I64 code to reference the new cells:

Alpha Cell (32 Bits) New Alpha (32 Bits) and I64 (64 Bits) Cell
PFN$AL_HEAD PFN$AI_HEAD
PFN$AL_TAIL PFN$AI_TAIL
PFN$AL_COLOR_HEAD PFN$AI_COLOR_HEAD
PFN$AL_COLOR_TAIL PFN$AI_COLOR_TAIL
PFN$AL_COUNT PFN$AI_COUNT
PFN$AL_LOLIMIT PFN$AI_LOLIMIT
PFN$AL_HILIMIT PFN$AI_HILIMIT
PFN$GL_MFYLSTHD PFN$AI_HEAD[PFN$C_MFYPAGLST]
SCH$GL_FREECNT SCH$GI_FREECNT
SCH$GL_FREELIM SCH$GI_FREELIM
SCH$GL_FREEREQ SCH$GI_FREEREQ
SCH$GL_MFYCNT SCH$GI_MFYCNT
SCH$GL_MFYLIM SCH$GI_MFYLIM
SCH$GL_MFYLOLIM SCH$GI_MFYLOLIM
SCH$GL_MFYLIMSV SCH$GQ_MFYLIMSV
SCH$GL_MFYLOSV SCH$GQ_MFYLOSV

The new PFN$AI cells are arrays of 32-bit PFNs or page counts on Alpha and 64-bit PFNs or page counts on I64. To reference the new PFN arrays, Hewlett-Packard recommends programming in C and using the PFN_T typedef.

Existing Code


    extern unsigned int pfn$al_head[];     unsigned int free_pfn;     free_pfn = pfn$al_head[PFN$C_FREPAGLST]; /* Read first free pfn */ 

New Code


    #include <lib_types.h>     extern PFN_T pfn$ai_head[];       PFN_T free_pfn;         free_pfn = pfn$ai_head[PFN$C_FREPAGLST]; /* Read first free pfn */ 

7.6.3 Physical Memory Page Counts

If your code references any of the data cells in the following table, you must modify your code on I64 to reference the new cells:

Alpha cell (32 Bits) New Alpha and I64 cell (64 Bits)
PFN$GL_PHYPGCNT MMG$GQ_FLUID_PGCNT
MMG$GL_PHYPGCNT MMG$GQ_PHYPGCNT
MMG$GL_MEMSIZE MMG$GQ_MEMSIZE

Programmers often confuse the functions of these data cells.

The MMG$GQ_FLUID_PGCNT data cell specifies the number of "fluid" pages in the system. Typically, this data cell is decremented when pages are permanently allocated for use by the system or drivers.

The MMG$GQ_PHYPGCNT data cell specifies the number of physical pages in the configuration. This number is derived from the PHYSICAL_MEMORY system parameter if the parameter is not -1. Typically, this data cell is only read by programs.

The MMG$GQ_MEMSIZE specifies the number of physical pages in the system regardless of system parameter settings.


Previous Next Contents Index