summaryrefslogtreecommitdiffstats
path: root/sys/i386/i386
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2013-07-26 19:06:14 +0000
committerjeff <jeff@FreeBSD.org>2013-07-26 19:06:14 +0000
commitc8d343ae8b6bda9a70a4901342a1dfd1f22e5b75 (patch)
treed8f12a25a404a20fd1aef3df74095696b97b85a4 /sys/i386/i386
parent29d3efe0a8f20e5159be92b6c7f7d4df1ae20fb6 (diff)
downloadFreeBSD-src-c8d343ae8b6bda9a70a4901342a1dfd1f22e5b75.zip
FreeBSD-src-c8d343ae8b6bda9a70a4901342a1dfd1f22e5b75.tar.gz
- Use kmem_malloc rather than kmem_alloc() for GDT/LDT/tss allocations etc.
This eliminates some unusual uses of that API in favor of more typical uses of kmem_malloc(). Discussed with: kib/alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/i386/i386')
-rw-r--r--sys/i386/i386/sys_machdep.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c
index 374690f..00d74d3 100644
--- a/sys/i386/i386/sys_machdep.c
+++ b/sys/i386/i386/sys_machdep.c
@@ -164,8 +164,9 @@ sysarch(td, uap)
break;
case I386_SET_LDT:
if (kargs.largs.descs != NULL) {
- lp = (union descriptor *)kmem_alloc(kernel_map,
- kargs.largs.num * sizeof(union descriptor));
+ lp = (union descriptor *)kmem_malloc(kernel_map,
+ kargs.largs.num * sizeof(union descriptor),
+ M_WAITOK);
if (lp == NULL) {
error = ENOMEM;
break;
@@ -298,7 +299,8 @@ i386_extend_pcb(struct thread *td)
0 /* granularity */
};
- ext = (struct pcb_ext *)kmem_alloc(kernel_map, ctob(IOPAGES+1));
+ ext = (struct pcb_ext *)kmem_malloc(kernel_map, ctob(IOPAGES+1),
+ M_WAITOK);
if (ext == 0)
return (ENOMEM);
bzero(ext, sizeof(struct pcb_ext));
@@ -471,8 +473,8 @@ user_ldt_alloc(struct mdproc *mdp, int len)
M_SUBPROC, M_WAITOK);
new_ldt->ldt_len = len = NEW_MAX_LD(len);
- new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map,
- round_page(len * sizeof(union descriptor)));
+ new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map,
+ round_page(len * sizeof(union descriptor)), M_WAITOK);
if (new_ldt->ldt_base == NULL) {
free(new_ldt, M_SUBPROC);
mtx_lock_spin(&dt_lock);
@@ -511,8 +513,8 @@ user_ldt_alloc(struct mdproc *mdp, int len)
M_SUBPROC, M_WAITOK);
new_ldt->ldt_len = len = NEW_MAX_LD(len);
- new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map,
- len * sizeof(union descriptor));
+ new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map,
+ len * sizeof(union descriptor), M_WAITOK);
if (new_ldt->ldt_base == NULL) {
free(new_ldt, M_SUBPROC);
mtx_lock_spin(&dt_lock);
OpenPOWER on IntegriCloud