[Kos-cvs] kos/modules/pmm _pmm_rmap.c,NONE,1.1
thomas at kos.enix.org
thomas at kos.enix.org
Tue Dec 28 19:45:54 CET 2004
- Previous message: [Kos-cvs] kos/modules/x86/task Makefile, 1.5, 1.6 _cpl0_switch.c,
1.7, 1.8 _thread_cpu_context.c, 1.16, 1.17 _tss.c, 1.8,
1.9 task.c, 1.5, 1.6
- Next message: [Kos-cvs] kos ChangeLog,1.43,1.44 MkVars,1.110,1.111
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/cvs/kos/kos/modules/pmm
In directory the-doors:/tmp/cvs-serv11338
Added Files:
_pmm_rmap.c
Log Message:
Forgot to add the _pmm_rmap.c fil
--- NEW FILE: _pmm_rmap.c ---
#include <kos/macros.h>
#include <debug/debug.h>
#include "_pmm.h"
/*
* This function returns the list of rmapping corresponding to a
* physical page, with the lock on the gpfm held, and returns the
* flags needed to unlock the gpfm.
*
* @param paddr The physical address of the page
*
* @param list Where the head of the rmapping structures list will be
* returned
*
* @param flags Where the flags needed to unlock the GPFM are returned
*
* @return Error code. If an error occurs, GPFM is left unlocked.
*/
result_t physmem_get_rmapping_list(paddr_t paddr, struct rmap **list,
spinlock_flags_t *flags)
{
struct gpfme *gpfme;
write_spin_lock (gpfm.lock, *flags);
gpfme = _physmem_get_gpfme_at_phys_addr(paddr);
if(gpfme == NULL)
{
DEBUG_PRINT3("[physmem_get_rmapping_list] Returning -EINVAL because no GPFME for phys addr 0x%x\n",
paddr);
write_spin_unlock(gpfm.lock, *flags);
return -EINVAL;
}
*list = gpfme->mapping_list;
return ESUCCESS;
}
/*
* This function updates the rmapping list head of a physical page,
* increments the reference counter of this page (by an increment
* which can be either positive or negative) and unlock the GPFM using
* the given flags.
*
* @param paddr The physical address of the page*
*
* @param list The new head of the list
*
* @param flags The flags to unlock the GPFM
*
* @param count The increment (either negative or positive) to apply
* to the reference counter of the page
*/
result_t physmem_commit_rmapping_list(paddr_t paddr, struct rmap *list,
spinlock_flags_t flags, int count)
{
struct gpfme *gpfme;
gpfme = _physmem_get_gpfme_at_phys_addr(paddr);
if(gpfme == NULL)
{
DEBUG_PRINT3("[physmem_get_rmapping_list] Returning -EINVAL because no GPFME for phys addr 0x%x\n",
paddr);
write_spin_unlock(gpfm.lock, flags);
return -EINVAL;
}
gpfme->mapping_list = list;
gpfme->ref_cnt += count;
write_spin_unlock(gpfm.lock, flags);
return ESUCCESS;
}
- Previous message: [Kos-cvs] kos/modules/x86/task Makefile, 1.5, 1.6 _cpl0_switch.c,
1.7, 1.8 _thread_cpu_context.c, 1.16, 1.17 _tss.c, 1.8,
1.9 task.c, 1.5, 1.6
- Next message: [Kos-cvs] kos ChangeLog,1.43,1.44 MkVars,1.110,1.111
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Kos-cvs
mailing list