Motorola MC68030 User Manual page 382

Enhanced 32-811 microprocessor
Hide thumbs Also See for MC68030:
Table of Contents

Advertisement

III
9-80
Declare Uppec Table_Index, Lower_LeveUndex;
I"table indexes
* /
Declare NumPages;
I" number of pages required to hold request
*/
Status
=
"Out of virtual Memory";
r
default result status to this error
*/
if SizelnBytes > 16 megabytes then exit Vallocate;
NumPages
=
(SizelnBytes+PageSize-1 )/PageSize;
I" Pages needed
/*
Scan User eligible page tables
for Upper_Table_Index
=
1 to 31 do
If Upper_Table[].Status
=
allocated then call SearchPageTable;
If Status
=
"OK" then Exit Vallocate;
end;
*/
*/
/*
Block not found so find upper level entry unallocated and call SearchPageTable that will 'expand'
*/
/*
the null table to hold the block.
'
*/
for Upper_Table_Index
=
1 to 31
,
If UppecTable[].Status
=
unallocated then call SearchPageTable;
/*
No more virtual space, exit leaving Status
=
"out of virtual memory"
exit Vallocate;
Procedure SearchPageTablej
r
Scan table pointed to by upper level index to see if it can hold the block. If not, see if it can be
1* be expanded. If successful then set flags in the page entries, set status to "OK" and User's
/*
virtual address
Declare Maxfound;
r
Count of consecutive free blocks found
Maxfound
=
0;
For Lower_LeveUndex
=
0 to Upper_Table[].Limit_Field
/*
count consecutive free pages until Maxfound met or not
If Lowec Table[].Status
=
invalid_unallocated then do
Maxfound
=
Maxfound+ 1 ;
if Maxfound
>=
NumPages then do
*/
*/
*/
*/
*/
*/
MC68030 USER'S MANUAL
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents