Sun Dec 13 12:21:27 2009 UTC ()
Replace a couple of magic numbers with proper macro.


(tsutsui)
diff -r1.40 -r1.41 src/sys/arch/hp300/hp300/genassym.cf
diff -r1.151 -r1.152 src/sys/arch/hp300/hp300/locore.s

cvs diff -r1.40 -r1.41 src/sys/arch/hp300/hp300/genassym.cf (expand / switch to unified diff)

--- src/sys/arch/hp300/hp300/genassym.cf 2009/12/10 05:10:01 1.40
+++ src/sys/arch/hp300/hp300/genassym.cf 2009/12/13 12:21:26 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: genassym.cf,v 1.40 2009/12/10 05:10:01 rmind Exp $ 1# $NetBSD: genassym.cf,v 1.41 2009/12/13 12:21:26 tsutsui Exp $
2 2
3# 3#
4# Copyright (c) 1982, 1990, 1993 4# Copyright (c) 1982, 1990, 1993
5# The Regents of the University of California. All rights reserved. 5# The Regents of the University of California. All rights reserved.
6# 6#
7# Redistribution and use in source and binary forms, with or without 7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions 8# modification, are permitted provided that the following conditions
9# are met: 9# are met:
10# 1. Redistributions of source code must retain the above copyright 10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer. 11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright 12# 2. Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the 13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution. 14# documentation and/or other materials provided with the distribution.
@@ -193,26 +193,28 @@ define FC_PURGE FC_PURGE @@ -193,26 +193,28 @@ define FC_PURGE FC_PURGE
193define INTIOBASE INTIOBASE 193define INTIOBASE INTIOBASE
194define MMUBASE MMUBASE 194define MMUBASE MMUBASE
195define MMUSTAT MMUSTAT 195define MMUSTAT MMUSTAT
196define MMUCMD MMUCMD 196define MMUCMD MMUCMD
197define MMUSSTP MMUSSTP 197define MMUSSTP MMUSSTP
198define MMUUSTP MMUUSTP 198define MMUUSTP MMUUSTP
199define MMUTBINVAL MMUTBINVAL 199define MMUTBINVAL MMUTBINVAL
200define MMU_BERR MMU_BERR 200define MMU_BERR MMU_BERR
201define MMU_ENAB MMU_ENAB 201define MMU_ENAB MMU_ENAB
202define MMU_FAULT MMU_FAULT 202define MMU_FAULT MMU_FAULT
203define MMU_CEN MMU_CEN 203define MMU_CEN MMU_CEN
204define MMU_IEN MMU_IEN 204define MMU_IEN MMU_IEN
205define MMU_FPE MMU_FPE 205define MMU_FPE MMU_FPE
 206define DC_FREEZE DC_FREEZE
 207define CACHE40_ON CACHE40_ON
206define CACHE_ON CACHE_ON 208define CACHE_ON CACHE_ON
207define CACHE_OFF CACHE_OFF 209define CACHE_OFF CACHE_OFF
208define CACHE_CLR CACHE_CLR 210define CACHE_CLR CACHE_CLR
209define IC_CLEAR IC_CLEAR 211define IC_CLEAR IC_CLEAR
210define DC_CLEAR DC_CLEAR 212define DC_CLEAR DC_CLEAR
211 213
212# pte/ste bits 214# pte/ste bits
213define PG_V PG_V 215define PG_V PG_V
214define PG_NV PG_NV 216define PG_NV PG_NV
215define PG_RO PG_RO 217define PG_RO PG_RO
216define PG_RW PG_RW 218define PG_RW PG_RW
217define PG_CI PG_CI 219define PG_CI PG_CI
218define PG_PROT PG_PROT 220define PG_PROT PG_PROT

cvs diff -r1.151 -r1.152 src/sys/arch/hp300/hp300/locore.s (expand / switch to unified diff)

--- src/sys/arch/hp300/hp300/locore.s 2009/12/13 11:24:02 1.151
+++ src/sys/arch/hp300/hp300/locore.s 2009/12/13 12:21:26 1.152
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.151 2009/12/13 11:24:02 tsutsui Exp $ */ 1/* $NetBSD: locore.s,v 1.152 2009/12/13 12:21:26 tsutsui Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1980, 1990, 1993 4 * Copyright (c) 1980, 1990, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department. 9 * Science Department.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -195,27 +195,27 @@ Lhaveihpib: @@ -195,27 +195,27 @@ Lhaveihpib:
195 RELOC(boothowto, %a0) | save reboot flags 195 RELOC(boothowto, %a0) | save reboot flags
196 movl %d7,%a0@ 196 movl %d7,%a0@
197 RELOC(bootdev, %a0) | and boot device 197 RELOC(bootdev, %a0) | and boot device
198 movl %d6,%a0@ 198 movl %d6,%a0@
199 199
200 /* 200 /*
201 * All data registers are now free. All address registers 201 * All data registers are now free. All address registers
202 * except %a5 are free. %a5 is used by the RELOC() macro, 202 * except %a5 are free. %a5 is used by the RELOC() macro,
203 * and cannot be used until after the MMU is enabled. 203 * and cannot be used until after the MMU is enabled.
204 */ 204 */
205 205
206/* determine our CPU/MMU combo - check for all regardless of kernel config */ 206/* determine our CPU/MMU combo - check for all regardless of kernel config */
207 movl #INTIOBASE+MMUBASE,%a1 207 movl #INTIOBASE+MMUBASE,%a1
208 movl #0x200,%d0 | data freeze bit 208 movl #DC_FREEZE,%d0 | data freeze bit
209 movc %d0,%cacr | only exists on 68030 209 movc %d0,%cacr | only exists on 68030
210 movc %cacr,%d0 | read it back 210 movc %cacr,%d0 | read it back
211 tstl %d0 | zero? 211 tstl %d0 | zero?
212 jeq Lnot68030 | yes, we have 68020/68040 212 jeq Lnot68030 | yes, we have 68020/68040
213 213
214 /* 214 /*
215 * 68030 models 215 * 68030 models
216 */ 216 */
217 217
218 RELOC(mmutype, %a0) | no, we have 68030 218 RELOC(mmutype, %a0) | no, we have 68030
219 movl #MMU_68030,%a0@ | set to reflect 68030 PMMU 219 movl #MMU_68030,%a0@ | set to reflect 68030 PMMU
220 RELOC(cputype, %a0) 220 RELOC(cputype, %a0)
221 movl #CPU_68030,%a0@ | and 68030 CPU 221 movl #CPU_68030,%a0@ | and 68030 CPU
@@ -518,27 +518,27 @@ Lhighcode: @@ -518,27 +518,27 @@ Lhighcode:
518 moveq #0,%d0 | ensure TT regs are disabled 518 moveq #0,%d0 | ensure TT regs are disabled
519 .long 0x4e7b0004 | movc %d0,%itt0 519 .long 0x4e7b0004 | movc %d0,%itt0
520 .long 0x4e7b0005 | movc %d0,%itt1 520 .long 0x4e7b0005 | movc %d0,%itt1
521 .long 0x4e7b0006 | movc %d0,%dtt0 521 .long 0x4e7b0006 | movc %d0,%dtt0
522 .long 0x4e7b0007 | movc %d0,%dtt1 522 .long 0x4e7b0007 | movc %d0,%dtt1
523 .word 0xf4d8 | cinva bc 523 .word 0xf4d8 | cinva bc
524 .word 0xf518 | pflusha 524 .word 0xf518 | pflusha
525#if PGSHIFT == 13 525#if PGSHIFT == 13
526 movl #0xc000,%d0 526 movl #0xc000,%d0
527#else 527#else
528 movl #0x8000,%d0 528 movl #0x8000,%d0
529#endif 529#endif
530 .long 0x4e7b0003 | movc %d0,%tc 530 .long 0x4e7b0003 | movc %d0,%tc
531 movl #0x80008000,%d0 531 movl #CACHE40_ON,%d0
532 movc %d0,%cacr | turn on both caches 532 movc %d0,%cacr | turn on both caches
533 jmp Lenab1:l | forced not be pc-relative 533 jmp Lenab1:l | forced not be pc-relative
534Lmotommu2: 534Lmotommu2:
535 movl #MMU_IEN+MMU_FPE,INTIOBASE+MMUBASE+MMUCMD 535 movl #MMU_IEN+MMU_FPE,INTIOBASE+MMUBASE+MMUCMD
536 | enable 68881 and i-cache 536 | enable 68881 and i-cache
537 RELOC(prototc, %a2) 537 RELOC(prototc, %a2)
538#if PGSHIFT == 13 538#if PGSHIFT == 13
539 movl #0x82d08b00,%a2@ | value to load TC with 539 movl #0x82d08b00,%a2@ | value to load TC with
540#else 540#else
541 movl #0x82c0aa00,%a2@ | value to load TC with 541 movl #0x82c0aa00,%a2@ | value to load TC with
542#endif 542#endif
543 pmove %a2@,%tc | load it 543 pmove %a2@,%tc | load it
544 jmp Lenab1:l | forced not be pc-relative 544 jmp Lenab1:l | forced not be pc-relative