English
Language : 

MC68030 Datasheet, PDF (356/602 Pages) Motorola, Inc – ENHANCED 32-BIT MICROPROCESSOR
Memory Management Unit
A routine similar to this that linearly extends (grows) a previously allocated memory block
could be written. A stack is a good example. The operating system can allocate the top of
the memory (the thirty-second upper level table entry) as a stack that grows downward from
the highest address. If a task needs several large stacks, a 16-Mbyte block can be used for
each stack, with a software flag set to indicate growth in a downward direction.
The logic of Vallocate is:
1. Validate the request and calculate number of pages required.
2. Scan each upper table entry's lower page tables (where they exist) looking for an ad-
equate group of unallocated pages.
3. If no space is found, see if the lower table is less than its maximum size and if the block
can be allocated by expanding it at the end.
4. If still no space is found, use the next free upper table entry and initialize its new lower
level page table to allocate the block here.
5. Set allocated page entries to indicate virgin status (allocated, invalid, and not swapped
out).
6. Return status. If status is OK, also return virtual address.
The code for Vallocate is:
(UNABLE TO LOCATE ART)
(UNABLE TO LOCATE ART)
(UNABLE TO LOCATE ART)
9.10.3 Bus Error Handler Routine
The routine that processes bus error exceptions is the most critical part of the memory
management services provided by the example operating system. This routine must
determine the validity of page faults and perform the necessary processing. It must identify
the conditions that aborted the executing task. The PTEST instruction can investigate the
cause of a bus error by performing a table search using the address and type of access that
produced the error, accumulating status information during the search.
When the PTEST instruction does not find any error, the bus error was most likely a
malfunction (for example, a transient memory failure). The operating system must respond
appropriately.
9-68
MC68030 USER’S MANUAL
MOTOROLA