minix/servers/is/dmp_ds.c
Cristiano Giuffrida c5b309ff07 Merge of Wu's GSOC 09 branch (src.20090525.r4372.wu)
Main changes:
- COW optimization for safecopy.
- safemap, a grant-based interface for sharing memory regions between processes.
- Integration with safemap and complete rework of DS, supporting new data types
  natively (labels, memory ranges, memory mapped ranges).
- For further information:
  http://wiki.minix3.org/en/SummerOfCode2009/MemoryGrants

Additional changes not included in the original Wu's branch:
- Fixed unhandled case in VM when using COW optimization for safecopy in case
  of a block that has already been shared as SMAP.
- Better interface and naming scheme for sys_saferevmap and ds_retrieve_map
  calls.
- Better input checking in syslib: check for page alignment when creating
  memory mapping grants.
- DS notifies subscribers when an entry is deleted.
- Documented the behavior of indirect grants in case of memory mapping.
- Test suite in /usr/src/test/safeperf|safecopy|safemap|ds/* reworked
  and extended.
- Minor fixes and general cleanup.
- TO-DO: Grant ids should be generated and managed the way endpoints are to make
sure grant slots are never misreused.
2010-01-14 15:24:16 +00:00

54 lines
1.1 KiB
C

#include "inc.h"
#include "../ds/store.h"
PRIVATE struct data_store ds_store[NR_DS_KEYS];
PUBLIC void data_store_dmp()
{
struct data_store *p;
static int prev_i = 0;
int r, i, n = 0;
if((r=getsysinfo(DS_PROC_NR, SI_DATA_STORE, ds_store)) != OK) {
printf("Couldn't talk to DS: %d.\n", r);
return;
}
printf("Data store contents:\n");
printf("-slot- ------key------ -----owner----- ---type--- ----value---\n");
for(i = prev_i; i < NR_DS_KEYS; i++) {
p = &ds_store[i];
if(!(p->flags & DSF_IN_USE))
continue;
printf("%6d %-15s %-15s ", i, p->key, p->owner);
switch(p->flags & DSF_MASK_TYPE) {
case DSF_TYPE_U32:
printf("%-10s %12u\n", "U32", p->u.u32);
break;
case DSF_TYPE_STR:
printf("%-10s %12s\n", "STR", p->u.string);
break;
case DSF_TYPE_MEM:
printf("%-10s %12u\n", "MEM", p->u.mem.length);
break;
case DSF_TYPE_MAP:
printf("%-10s %9u/%3u\n", "MAP", p->u.map.length,
p->u.map.sindex);
break;
case DSF_TYPE_LABEL:
printf("%-10s %12u\n", "LABEL", p->u.u32);
break;
default:
return;
}
if(n++ == 21)
break;
}
if (i >= NR_DS_KEYS) i = 0;
else printf("--more--\r");
prev_i = i;
}