Add a flag to grants system indicating a slot is VALID; so a slot

can be reserved (USED), while toggling VALID on and off.
This commit is contained in:
Ben Gras
2006-06-27 12:19:45 +00:00
parent a587273c56
commit 607fb6bf7f
3 changed files with 19 additions and 5 deletions

View File

@@ -305,7 +305,7 @@ int access;
GID_CHECK(gid);
ACCESS_CHECK(access);
grants[gid].cp_flags = access | CPF_DIRECT | CPF_USED;
grants[gid].cp_flags = access | CPF_DIRECT | CPF_USED | CPF_VALID;
grants[gid].cp_u.cp_direct.cp_who_to = who;
grants[gid].cp_u.cp_direct.cp_start = addr;
grants[gid].cp_u.cp_direct.cp_len = bytes;
@@ -322,7 +322,7 @@ cp_grant_id_t his_gid;
GID_CHECK(gid);
/* Fill in new slot data. */
grants[gid].cp_flags = CPF_USED | CPF_INDIRECT;
grants[gid].cp_flags = CPF_USED | CPF_INDIRECT | CPF_VALID;
grants[gid].cp_u.cp_indirect.cp_who_to = who_to;
grants[gid].cp_u.cp_indirect.cp_who_from = who_from;
grants[gid].cp_u.cp_indirect.cp_grant = his_gid;
@@ -342,7 +342,7 @@ int access;
ACCESS_CHECK(access);
/* Fill in new slot data. */
grants[gid].cp_flags = CPF_USED | CPF_MAGIC | access;
grants[gid].cp_flags = CPF_USED | CPF_MAGIC | CPF_VALID | access;
grants[gid].cp_u.cp_magic.cp_who_to = who_to;
grants[gid].cp_u.cp_magic.cp_who_from = who_from;
grants[gid].cp_u.cp_magic.cp_start = addr;
@@ -351,3 +351,15 @@ int access;
return 0;
}
PUBLIC int
cpf_setgrant_disable(gid)
cp_grant_id_t gid;
{
GID_CHECK(gid);
/* Grant is now no longer valid, but still in use. */
grants[gid].cp_flags = CPF_USED;
return 0;
}