summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-02 11:58:29 +0200
committerThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-02 11:58:29 +0200
commitbe13bf257d33bb8c6be14f0c879b963491476c64 (patch)
treecf302605c5812eafaf4368c9b39011f49e38baae
parent68be60995de6853e1cd5b9d6f83519a9be6f99fc (diff)
Revert "Use the default buffer placement as a default value for validate set_flags."
-rw-r--r--src/wsbm_manager.c34
-rw-r--r--src/wsbm_manager.h5
2 files changed, 11 insertions, 28 deletions
diff --git a/src/wsbm_manager.c b/src/wsbm_manager.c
index 3058b07..e40571d 100644
--- a/src/wsbm_manager.c
+++ b/src/wsbm_manager.c
@@ -444,7 +444,6 @@ wsbmBOSetStatus(struct _WsbmBufferObject *buf,
uint32_t setFlags, uint32_t clrFlags)
{
struct _WsbmBufStorage *storage = buf->storage;
- int ret;
if (!storage)
return 0;
@@ -452,12 +451,7 @@ wsbmBOSetStatus(struct _WsbmBufferObject *buf,
if (storage->pool->setStatus == NULL)
return -EINVAL;
- ret = storage->pool->setStatus(storage, setFlags, clrFlags);
- if (ret)
- return ret;
-
- buf->placement = (buf->placement | setFlags) & ~(clrFlags);
- return 0;
+ return storage->pool->setStatus(storage, setFlags, clrFlags);
}
void
@@ -924,9 +918,8 @@ wsbmBOFreeList(struct _WsbmBufferList *list)
}
static int
-wsbmAddValidateItem(struct _ValidateList *list, void *buf,
- uint32_t def_placement, uint64_t flags, uint64_t mask,
- int *itemLoc,
+wsbmAddValidateItem(struct _ValidateList *list, void *buf, uint64_t flags,
+ uint64_t mask, int *itemLoc,
struct _ValidateNode **pnode, int *newItem)
{
struct _ValidateNode *node, *cur;
@@ -952,10 +945,7 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf,
}
if (!cur) {
- uint64_t first_flags = ((uint64_t) def_placement & ~mask) |
- (flags & mask & ~WSBM_PL_MASK_MEM_CACHE);
-
- cur = validateListAddNode(list, buf, hash, first_flags, mask);
+ cur = validateListAddNode(list, buf, hash, flags, mask);
if (!cur)
return -ENOMEM;
*newItem = 1;
@@ -964,8 +954,8 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf,
uint64_t set_flags = flags & mask;
uint64_t clr_flags = (~flags) & mask;
- if (((cur->clr_flags | clr_flags) & WSBM_PL_MASK_MEM_CACHE) ==
- WSBM_PL_MASK_MEM_CACHE) {
+ if (((cur->clr_flags | clr_flags) & WSBM_PL_MASK_MEM) ==
+ WSBM_PL_MASK_MEM) {
/*
* No available memory type left. Bail.
*/
@@ -973,15 +963,15 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf,
}
if ((cur->set_flags | set_flags) &
- (cur->clr_flags | clr_flags) & ~WSBM_PL_MASK_MEM_CACHE) {
+ (cur->clr_flags | clr_flags) & ~WSBM_PL_MASK_MEM) {
/*
* Conflicting flags. Bail.
*/
return -EINVAL;
}
- cur->set_flags &= ~(clr_flags & WSBM_PL_MASK_MEM_CACHE);
- cur->set_flags |= (set_flags & ~WSBM_PL_MASK_MEM_CACHE);
+ cur->set_flags &= ~(clr_flags & WSBM_PL_MASK_MEM);
+ cur->set_flags |= (set_flags & ~WSBM_PL_MASK_MEM);
cur->clr_flags |= clr_flags;
}
*itemLoc = cur->listItem;
@@ -1005,8 +995,7 @@ wsbmBOAddListItem(struct _WsbmBufferList *list,
if (list->hasKernelBuffers) {
ret = wsbmAddValidateItem(&list->kernelBuffers,
storage->pool->kernel(storage),
- buf->placement, flags, mask, itemLoc,
- node, &dummy);
+ flags, mask, itemLoc, node, &dummy);
if (ret)
goto out_unlock;
} else {
@@ -1015,8 +1004,7 @@ wsbmBOAddListItem(struct _WsbmBufferList *list,
}
ret = wsbmAddValidateItem(&list->userBuffers, storage,
- buf->placement, flags, mask, &dummy,
- &dummyNode, &newItem);
+ flags, mask, &dummy, &dummyNode, &newItem);
if (ret)
goto out_unlock;
diff --git a/src/wsbm_manager.h b/src/wsbm_manager.h
index e90f135..ee0636f 100644
--- a/src/wsbm_manager.h
+++ b/src/wsbm_manager.h
@@ -75,11 +75,6 @@ struct _WsbmBufferList;
#define WSBM_SYNCCPU_DONT_BLOCK (1 << 2)
#define WSBM_SYNCCPU_TRY_CACHED (1 << 3)
-#define WSBM_PL_MASK_MEM_CACHE (WSBM_PL_MASK_MEM | \
- WSBM_PL_FLAG_CACHED | \
- WSBM_PL_FLAG_UNCACHED | \
- WSBM_PL_FLAG_WC)
-
extern void *wsbmBOMap(struct _WsbmBufferObject *buf, unsigned mode);
extern void wsbmBOUnmap(struct _WsbmBufferObject *buf);
extern int wsbmBOSyncForCpu(struct _WsbmBufferObject *buf, unsigned mode);