static void agp_remove_from_pool(struct agp_memory *temp) { struct agp_memory *prev; struct agp_memory *next; /* Check to see if this is even in the memory pool */ DBG("mem=%p", temp); if (agp_find_mem_by_key(temp->key) != NULL) { next = temp->next; prev = temp->prev; if (prev != NULL) { prev->next = next; if (next != NULL) next->prev = prev; } else { /* This is the first item on the list */ if (next != NULL) next->prev = NULL; agp_fe.current_controller->pool = next; } } }
static int agpioc_deallocate_wrap(agp_file_private * priv, unsigned long arg) { agp_memory *memory; memory = agp_find_mem_by_key((int) arg); if (memory == NULL) { return -EINVAL; } agp_free_memory_wrap(memory); return 0; }
static int agpioc_deallocate_wrap(struct agp_file_private *priv, int arg) { struct agp_memory *memory; DBG(""); memory = agp_find_mem_by_key(arg); if (memory == NULL) return -EINVAL; agp_free_memory_wrap(memory); return 0; }
static int agpioc_unbind_wrap(agp_file_private * priv, unsigned long arg) { agp_memory *memory; agp_unbind unbind; if (copy_from_user(&unbind, (void *) arg, sizeof(agp_unbind))) { return -EFAULT; } memory = agp_find_mem_by_key(unbind.key); if (memory == NULL) { return -EINVAL; } return agp_unbind_memory(memory); }
static int agpioc_bind_wrap(agp_file_private * priv, unsigned long arg) { agp_bind bind_info; agp_memory *memory; if (copy_from_user(&bind_info, (void *) arg, sizeof(agp_bind))) { return -EFAULT; } memory = agp_find_mem_by_key(bind_info.key); if (memory == NULL) { return -EINVAL; } return agp_bind_memory(memory, bind_info.pg_start); }
static int compat_agpioc_unbind_wrap(struct agp_file_private *priv, void __user *arg) { struct agp_memory *memory; struct agp_unbind32 unbind; DBG(""); if (copy_from_user(&unbind, arg, sizeof(unbind))) return -EFAULT; memory = agp_find_mem_by_key(unbind.key); if (memory == NULL) return -EINVAL; return agp_unbind_memory(memory); }
static int compat_agpioc_bind_wrap(struct agp_file_private *priv, void __user *arg) { struct agp_bind32 bind_info; struct agp_memory *memory; DBG(""); if (copy_from_user(&bind_info, arg, sizeof(bind_info))) return -EFAULT; memory = agp_find_mem_by_key(bind_info.key); if (memory == NULL) return -EINVAL; return agp_bind_memory(memory, bind_info.pg_start); }