Cache coloring allows you to separate the cache memory for exclusiv access for some important tasks. Some selected bits of the physical address will be used to assign to a part of the cache memory. If you have a special pager - VM - you can manage the physical memory so that each task has his own part of cache memory. So you can allways plan the use of this very fast memory to speedup you task.
To calculate the number of bits do you need to know the cache memory size, the
size of a physical page an the associativity of the cache architecture. Divide
the cache size by the page size * assoziativity and you get the number of
colors. Take log2 of this number an you get the number of bits. (For
example: 32 colors -> 5 bits)
1.2 Arguments
RMGR allows you to specify a set of modules wich will be passed to any other module. We use this feature as follows:
%:col:[0,0x]map
%colb:map
%mcp:num
%small:bool
Indicated by col can be specified a decimal, octal or hexadecimal map. (Use 0x and 0 to denote hexadecimal resp. octal maps.)
If you want zu specify binary maps use colb .
To specify the mcp write the number after mcp .
Small address page support can be turned on with small.
2 VM SPECIFIC PROTOCOL
The VM pager is a single task. Each further task who should be controled by VM
will be started with VM as standard pager. So each page fault will be handled
by VM.
Some special tasks may want to allocate pages with a special color or need some information from VM. Therefore there exists a special protocol.
You can use this blank protocol if you want. But there is a CLIENT LIBRARY
(next section) that provides you a set of C functions. If you want to know the
protocoll please have a look in the detailed documentation in vm/doc/vm.lyx.
3 CLIENT LIBRARY
To hide the the VM SPECIFIC PROTOCOL (see previews section) there is client
library which provides a set of C functions to call the server with the special
IPC call.
3.1 Synopsis
#include <l4/vm/vm.h>
void vm_init(void);
int vm_map(vm_offset_t page,vm_offset_t va);
int vm_unmap(vm_offset_t va);
vm_offset_t vm_map_from_color(unsigned color);
vm_offset_t vm_virt_to_phys(vm_offset_t va);
int vm_get_valid_colors(dword_t *d0, dword_t *d1);
unsigned vm_get_max_colors(void);
int vm_ping(void);
dword_t vm_request_contiguous(vm_offset_t va, dword_t size);
3.2 Description
In the case of IPC error all functions returns with -1.
Results
If the requested pages is still not mapped to any other task VM mapps page
to the address va
in your address space and returns true (1), otherwise false(0).
Results
vm_unmap
returns with false (0) if the page is not mapped or true (1) if request is
proceeded.
Results
If there is a page of this color left it will be mapped in your address space
and returns the address, -2 if no page of this color is available or -3 if the
requested color isn't valid for the requester.