summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/mptable.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-08-16 00:41:40 +0000
committerbde <bde@FreeBSD.org>1998-08-16 00:41:40 +0000
commit9fa8a2d79412b133fbecb03e9fd619c95770f665 (patch)
tree1c5ca30276ee0bed24493ee6bdf7a165c9db1679 /sys/i386/include/mptable.h
parent8814b380eb06aeefb7ad5557e2cbb58aafb4c057 (diff)
downloadFreeBSD-src-9fa8a2d79412b133fbecb03e9fd619c95770f665.zip
FreeBSD-src-9fa8a2d79412b133fbecb03e9fd619c95770f665.tar.gz
pmap.c:
Cast pointers to (vm_offset_t) instead of to (u_long) (as before) or to (uintptr_t)(void *) (as would be more correct). Don't cast vm_offset_t's to (u_long) just to do arithmetic on them. mp_machdep.c: Cast pointers to (uintptr_t) instead of to (u_long). Don't forget to cast pointers to (void *) first or to recover from integral possible integral promotions, although this is too much work for machine-dependent code. vm code generally avoids warnings for pointer vs long size mismatches by using vm_offset_t to represent pointers; pmap.c often uses plain `unsigned int' instead of vm_offset_t and didn't use u_long elsewhere, but this style was messed up by code apparently imported from mp_machdep.c.
Diffstat (limited to 'sys/i386/include/mptable.h')
-rw-r--r--sys/i386/include/mptable.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index c5e392a..8052740 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.75 1998/05/17 18:53:17 tegge Exp $
+ * $Id: mp_machdep.c,v 1.76 1998/05/17 22:12:08 tegge Exp $
*/
#include "opt_smp.h"
@@ -550,7 +550,7 @@ mp_enable(u_int boot_addr)
POSTCODE(MP_ENABLE_POST);
/* turn on 4MB of V == P addressing so we can get to MP table */
- *(int *)PTD = PG_V | PG_RW | ((u_long)KPTphys & PG_FRAME);
+ *(int *)PTD = PG_V | PG_RW | ((uintptr_t)(void *)KPTphys & PG_FRAME);
invltlb();
/* examine the MP table for needed info, uses physical addresses */
@@ -1680,8 +1680,8 @@ start_all_aps(u_int boot_addr)
bcopy(PTD, newptd, PAGE_SIZE); /* inc prv page pde */
/* set up 0 -> 4MB P==V mapping for AP boot */
- newptd[0] = (pd_entry_t) (PG_V | PG_RW |
- ((u_long)KPTphys & PG_FRAME));
+ newptd[0] = (void *)(uintptr_t)(PG_V | PG_RW |
+ ((uintptr_t)(void *)KPTphys & PG_FRAME));
/* store PTD for this AP's boot sequence */
myPTD = (pd_entry_t *)vtophys(newptd);
OpenPOWER on IntegriCloud