Guardian Procedure Calls Reference Manual
WARNING! On NSAA systems, the FILE_READ64_, FILE_WRITE64_ and FILE_WRITEREAD64_
procedures use the process file segment (PFS) of the caller to store the data being read or written.
The maximum PFS size is 32 MB. This limits the number of concurrent no-wait operations with large
read-count or write-count values. Perform the following steps to work around this limit:
1. Define the read and write buffers with sizes in multiples of 16KB.
2. Call the USERIOBUFFER_ALLOW_ procedure before making any calls to these procedures.
3. Allocate an extended data segment using the SEGMENT_ALLOCATE64_ procedure.
4. Define a pool on the segment using the POOL64_DEFINE_ procedure.
5. Allocate buffers from the pool boundaries. The following is an example that allocates buffers:
#include <kpool64.h>
const uint64 POOL64_PAGE = 0x4000;
const uint64 POOL64_PAGE_MASK = 0Xffffffffffffc000;
void _ptr64 * POOL64_GET_PAGE( NSK_POOL64_PTR pool_ptr,
uint64 size_needed,
uint32 *error ) {
void _ptr64 * ptr = POOL64_GET_( pool_ptr,
size_needed + POOL64_PAGE,
error );
if ( *error == POOL64_OK ){
void _ptr64 * ptr1 = (void _ptr64 *)(((uint64)ptr & POOL64_PAGE_MASK) +
POOL64_PAGE);
((void _ptr64 * _ptr64 *)ptr1)[-1] = ptr;
return ptr1;
}
return ptr;
}
uint32 POOL64_PUT_PAGE( NSK_POOL64_PTR pool_ptr,
void _ptr64 * ptr ){
return POOL64_PUT_( pool_ptr, ((void _ptr64 * _ptr64 *)ptr)[-1] );
}
This example is space-inefficient, because each buffer allocated consumes at least one more
page of pool space than the size of the buffer. It would be more memory-efficient to maintain
a segment of buffer space, allocating one or more whole pages for each request. One such
scheme would use a bit map to identify available pages; the client would specify the length
when returning an element to the pool.
360 Guardian Procedure Calls (F)