* Added [un]lock_memory_etc() versions that accept a team_id as first argument.

This allows drivers to lock the memory outside of the original team context.
* create_area_etc() got a struct team as first argument, but that should have
  been a team_id.
* Removed delete_area_etc() - there is already vm_delete_area() doing the same
  thing.
* Renamed vm_get_address_space_by_id() to vm_get_address_space(), as there is
  no other method of getting an address space.
* Removed erroneous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26455 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-07-16 22:55:17 +00:00
parent cb9191556c
commit 736352dcf5
9 changed files with 89 additions and 73 deletions
+7 -3
View File
@@ -144,8 +144,12 @@ extern thread_id spawn_kernel_thread(thread_func function,
extern int send_signal_etc(pid_t thread, uint signal, uint32 flags);
/* virtual memory */
extern long lock_memory(void *buffer, ulong numBytes, ulong flags);
extern long unlock_memory(void *buffer, ulong numBytes, ulong flags);
extern status_t lock_memory_etc(team_id team, void *buffer, size_t numBytes,
uint32 flags);
extern status_t lock_memory(void *buffer, size_t numBytes, uint32 flags);
extern status_t unlock_memory_etc(team_id team, void *address,
size_t numBytes, uint32 flags);
extern status_t unlock_memory(void *buffer, size_t numBytes, uint32 flags);
extern long get_memory_map(const void *buffer, ulong size,
physical_entry *table, long numEntries);
extern area_id map_physical_memory(const char *areaName,
@@ -168,7 +172,7 @@ extern uint64 parse_expression(const char *string);
extern int add_debugger_command(char *name, debugger_command_hook hook, char *help);
extern int remove_debugger_command(char *name,
debugger_command_hook hook);
debugger_command_hook hook);
/* Miscellaneous */
extern void spin(bigtime_t microseconds);
+1 -2
View File
@@ -46,9 +46,8 @@ void permit_page_faults(void);
void forbid_page_faults(void);
// private kernel only extension (should be moved somewhere else):
area_id create_area_etc(struct team *team, const char *name, void **address,
area_id create_area_etc(team_id team, const char *name, void **address,
uint32 addressSpec, uint32 size, uint32 lock, uint32 protection);
status_t delete_area_etc(struct team *team, area_id area);
status_t vm_unreserve_address_range(team_id team, void *address, addr_t size);
status_t vm_reserve_address_range(team_id team, void **_address,
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2005, Axel Dörfler, [email protected]. All rights reserved.
* Copyright 2002-2008, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -32,7 +32,7 @@ struct vm_address_space *vm_kernel_address_space(void);
team_id vm_kernel_address_space_id(void);
struct vm_address_space *vm_get_current_user_address_space(void);
team_id vm_current_user_address_space_id(void);
struct vm_address_space *vm_get_address_space_by_id(team_id aid);
struct vm_address_space *vm_get_address_space(team_id team);
void vm_put_address_space(struct vm_address_space *aspace);
#define vm_swap_address_space(aspace) arch_vm_aspace_swap(aspace)