Sync with arch/m68k/m68k/pmap_motorola.c rev 1.38:

> Remove ({ }) gcc extensions and use static inline functions instead.
This commit is contained in:
tsutsui 2008-06-29 09:03:47 +00:00
parent 06e75299f3
commit 2c77262457
2 changed files with 42 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.136 2008/04/28 20:23:12 martin Exp $ */
/* $NetBSD: pmap.c,v 1.137 2008/06/29 09:03:47 tsutsui Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.136 2008/04/28 20:23:12 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.137 2008/06/29 09:03:47 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -335,21 +335,26 @@ char *vmmap;
#define PAGE_IS_MANAGED(pa) (pmap_initialized \
&& vm_physseg_find(atop((pa)), NULL) != -1)
#define pa_to_pvh(pa) \
({ \
int bank_, pg_ = 0; /* gcc4 -Wunitialized */ \
\
bank_ = vm_physseg_find(atop((pa)), &pg_); \
&vm_physmem[bank_].pmseg.pvent[pg_]; \
})
static inline struct pv_entry *pa_to_pvh(paddr_t pa);
static inline char *pa_to_attribute(paddr_t pa);
#define pa_to_attribute(pa) \
({ \
int bank_, pg_ = 0; /* gcc4 -Wuninitialized */ \
\
bank_ = vm_physseg_find(atop((pa)), &pg_); \
&vm_physmem[bank_].pmseg.attrs[pg_]; \
})
static inline struct pv_entry *
pa_to_pvh(paddr_t pa)
{
int bank, pg = 0; /* gcc4 -Wunitialized */
bank = vm_physseg_find(atop((pa)), &pg);
return &vm_physmem[bank].pmseg.pvent[pg];
}
static inline char *
pa_to_attribute(paddr_t pa)
{
int bank, pg = 0; /* gcc4 -Wuninitialized */
bank = vm_physseg_find(atop((pa)), &pg);
return &vm_physmem[bank].pmseg.attrs[pg];
}
/*
* Initialize the pmap module.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.104 2008/04/28 20:23:15 martin Exp $ */
/* $NetBSD: pmap.c,v 1.105 2008/06/29 09:04:19 tsutsui Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.104 2008/04/28 20:23:15 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105 2008/06/29 09:04:19 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -317,21 +317,26 @@ u_int *CMAP1, *CMAP2, *vmpte, *msgbufmap;
#define PAGE_IS_MANAGED(pa) (pmap_initialized \
&& vm_physseg_find(atop((pa)), NULL) != -1)
#define pa_to_pvh(pa) \
({ \
int bank_, pg_ = 0; /* XXX gcc4 -Wuninitialized */ \
\
bank_ = vm_physseg_find(atop((pa)), &pg_); \
&vm_physmem[bank_].pmseg.pvent[pg_]; \
})
static inline struct pv_entry *pa_to_pvh(paddr_t pa);
static inline char *pa_to_attribute(paddr_t pa);
#define pa_to_attribute(pa) \
({ \
int bank_, pg_ = 0; /* XXX gcc4 -Wuninitialized */ \
\
bank_ = vm_physseg_find(atop((pa)), &pg_); \
&vm_physmem[bank_].pmseg.attrs[pg_]; \
})
static inline struct pv_entry *
pa_to_pvh(paddr_t pa)
{
int bank, pg = 0; /* XXX gcc4 -Wuninitialized */
bank = vm_physseg_find(atop((pa)), &pg);
return &vm_physmem[bank].pmseg.pvent[pg];
}
static inline char *
pa_to_attribute(paddr_t pa)
{
int bank, pg = 0; /* XXX gcc4 -Wuninitialized */
bank = vm_physseg_find(atop((pa)), &pg);
return &vm_physmem[bank].pmseg.attrs[pg];
}
/*
* The preallocated virtual memory range used by the I/O area. Their