|
HP OpenVMS systems documentation |
Previous | Contents | Index |
The following JSB routines are available on Alpha only. Replace the JSB calls with the equivalent standard routine calls.
Alpha JSB Routine | Alpha and I64 Routine |
---|---|
mmg$alloc_pfn | mmg$allocate_pfn |
mmg$alloc_zero_pfn | mmg$allocate_pfn |
Prototype
PFN_T mmg$allocate_pfn (unsigned int flags, int color unsigned __int64 byte_align); |
The following table lists MMG flags and their meanings:
MMG Flag | Meaning |
---|---|
MMG$M_COLOR_MUST | Return PFN must be of color (RAD) specified |
MMG$M_COLOR_RANDOM | Return PFN should be a random color (RAD) |
MMG$M_ZEROED | Allocate zeroed page |
Color: RAD on systems with NUMA support enabled
Byte_align: If non-zero, the byte alignment for the physical page to be allocated. For example, specify the virtual address of the mapping if you want the virtual and physical pages to be aligned the same.
This routine returns a 32-bit PFN on Alpha and a 64-bit PFN on I64. After the function call, the resulting PFN must be handled as a 64-bit value on I64.
Existing Code
unsigned int pfn; PFN_PQ pfn_rec; pfn = mmg_std$alloc_pfn_64 (&pfn_rec); /* Allocate a PFN */ if (pfn == 0) /* Error if no PFN allocated */ |
New Code
#include <lib_types.h> PFN_T pfn; PFN_PQ pfn_rec; pfn = mmg$allocate_pfn (0, 0, 0); /* Allocate a PFN */ if (pfn != 0) pfn_req = pfn_to_entry(pfn); if (pfn == 0) /* Error if no PFN allocated */ |
If your code calls any of the following routines, you must modify your code on I64:
; // largest_chunk )
Alpha Routine | New Alpha and I64 Routine: mmg$allocate_contig_pfns |
---|---|
pfn =
mmg_std$allo_contig (
pfn_count); |
pfn =
mmg$allocate_contig_pfns (
pfn_count, 0, // flags MMG$K_NO_RAD, // color 0, // byte_align 0, // low_pfn 0, // high_pfn, 0); // largest_chunk |
pfn =
mmg_std$allo_contig_pfn (
pfn_count, high_pfn); |
pfn =
mmg$allocate_contig_pfns (
pfn_count, 0, // flags MMG$K_NO_RAD, // color 0, // byte_align 0, // low_pfn high_pfn // high_pfn, 0); // largest_chunk |
pfn =
mmg_std$allo_contig_a (
pfn_count, byte_align); |
pfn =
mmg$allocate_contig_pfns (
pfn_count, 0, // flags MMG$K_NO_RAD, // color byte_align, // byte_align 0, // low_pfn 0, // high_pfn, 0); // largest_chunk |
pfn =
mmg_std$allo_pfn_a(
pfn_count, byte_align, high_pfn); |
pfn =
mmg$allocate_contig_pfns (
pfn_count, 0, // flags MMG$K_NO_RAD, // color byte_align, // byte_align 0, // low_pfn high_pfn, // high_pfn, 0 |
pfn =
mmg_std$allo_contig_color_a (
pfn_count, flags, byte_align, color, &largest_chunk); |
pfn =
mmg$allocate_contig_pfns (
pfn_count, flags, color, byte_align, 0, // low_pfn 0, // high_pfn, &largest_chunk); // largest_chunk |
pfn =
mmg_std$allo_contig_range (
low_pfn pfn_count, high_pfn, byte_align, &largest_chunk); |
pfn =
mmg$allocate_contig_pfns (
pfn_count, 0, // flags 0, // color byte_align, low_pfn, high_pfn, &largest_chunk); |
The following JSB routines are available on Alpha only. Replace the JSB calls with the equivalent standard routine calls.
Alpha JSB Routine | Alpha and I64 Routine |
---|---|
mmg$allo_contig | mmg$allocate_contig_pfns |
mmg$allo_contig_pfn | mmg$allocate_contig_pfns |
Prototype
PFN_T mmg$allocate_contig_pfns (unsigned __int64 pfn_count, int flags, int color, unsigned __int64 byte_align, PFN_T low_pfn, PFN_T high_pfn, unsigned __int64 * largest_chunk); |
Page_count: Number of pages to allocate
The following table shows the MMG flags:
MMG Flag | Meaning |
---|---|
MMG$M_COLOR_MUST | Return PFN must be of color (RAD) specified |
MMG$M_COLOR_RANDOM | Return PFN should be a random color (RAD) |
Color: RAD on systems with NUMA support enabled
Byte_align: the byte alignment for the PFN. For example, specify the virtual address of the mapping if you want the virtual and physical pages to be aligned the same.
Low_pfn: Lowest PFN in range to allocate
High_pfn: Highest PFN in range to allocate (0, if no range)
Largest_chunk: If non-zero, address to return the largest number of free PFNs found. This number of PFNs has been allocated instead of the number specified in the page_count argument. If zero, the requested number of PFNs must be returned or the call fails.
This routine returns a 32-bit PFN on Alpha and a 64-bit PFN on I64. After the function call, the resulting PFN must be handled as a 64-bit value on I64.
Existing Code
unsigned int first_pfn; unsigned int page_count; first_pfn = mmg_std$allo_contig (page_count); if (first_pfn == 0) /* Error: no PFNs allocated */ |
New Code
#include <lib_types.h> PFN_T first_pfn; unsigned int page_count; first_pfn = mmg$allocate_contig_pfns ( page_count, 0, MMG$K_NO_RAD, 0, 0, 0, 0); if (first_pfn == 0) /* Error if no PFNs allocated */ |
Previous | Next | Contents | Index |