Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1874
b: refs/heads/master
c: e29b545
h: refs/heads/master
v: v3
  • Loading branch information
Michael Werner authored and Dave Jones committed Jun 7, 2005
1 parent b4edcfc commit 7c012e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0de98fa16169562bd74913c6c9b3857f9065c79
refs/heads/master: e29b545cb153f230fbd8ff4c19bc98ab950f9f5c
12 changes: 9 additions & 3 deletions trunk/drivers/char/agp/sgi-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
off_t j;
void *temp;
struct agp_bridge_data *bridge;
u64 *table;

bridge = mem->bridge;
if (!bridge)
return -EINVAL;

table = (u64 *)bridge->gatt_table;

temp = bridge->current_size;

switch (bridge->driver->size_type) {
Expand Down Expand Up @@ -175,7 +178,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
j = pg_start;

while (j < (pg_start + mem->page_count)) {
if (*(bridge->gatt_table + j))
if (table[j])
return -EBUSY;
j++;
}
Expand All @@ -186,7 +189,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
}

for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
*(bridge->gatt_table + j) =
table[j] =
bridge->driver->mask_memory(bridge, mem->memory[i],
mem->type);
}
Expand All @@ -200,6 +203,7 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
{
size_t i;
struct agp_bridge_data *bridge;
u64 *table;

bridge = mem->bridge;
if (!bridge)
Expand All @@ -209,8 +213,10 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
return -EINVAL;
}

table = (u64 *)bridge->gatt_table;

for (i = pg_start; i < (mem->page_count + pg_start); i++) {
*(bridge->gatt_table + i) = 0;
table[i] = 0;
}

bridge->driver->tlb_flush(mem);
Expand Down

0 comments on commit 7c012e0

Please sign in to comment.