TAB/space/indent cleanup.diff -r1.208 -r1.209 src/sys/arch/x68k/conf/GENERIC
(isaki)
--- src/sys/arch/x68k/conf/GENERIC 2023/02/12 14:50:42 1.208
+++ src/sys/arch/x68k/conf/GENERIC 2024/01/07 07:58:33 1.209
@@ -1,38 +1,38 @@ | @@ -1,38 +1,38 @@ | |||
1 | # $NetBSD: GENERIC,v 1.208 2023/02/12 14:50:42 abs Exp $ | 1 | # $NetBSD: GENERIC,v 1.209 2024/01/07 07:58:33 isaki Exp $ | |
2 | # | 2 | # | |
3 | # GENERIC machine description file | 3 | # GENERIC machine description file | |
4 | # | 4 | # | |
5 | # This machine description file is used to generate the default NetBSD | 5 | # This machine description file is used to generate the default NetBSD | |
6 | # kernel. The generic kernel does not include all options, subsystems | 6 | # kernel. The generic kernel does not include all options, subsystems | |
7 | # and device drivers, but should be useful for most applications. | 7 | # and device drivers, but should be useful for most applications. | |
8 | # | 8 | # | |
9 | # The machine description file can be customised for your specific | 9 | # The machine description file can be customised for your specific | |
10 | # machine to reduce the kernel size and improve its performance. | 10 | # machine to reduce the kernel size and improve its performance. | |
11 | # | 11 | # | |
12 | # For further information on compiling NetBSD kernels, see the config(8) | 12 | # For further information on compiling NetBSD kernels, see the config(8) | |
13 | # man page. | 13 | # man page. | |
14 | # | 14 | # | |
15 | # For further information on hardware support for this architecture, see | 15 | # For further information on hardware support for this architecture, see | |
16 | # the intro(4) man page. For further information about kernel options | 16 | # the intro(4) man page. For further information about kernel options | |
17 | # for this architecture, see the options(4) man page. For an explanation | 17 | # for this architecture, see the options(4) man page. For an explanation | |
18 | # of each device driver in this file see the section 4 man page for the | 18 | # of each device driver in this file see the section 4 man page for the | |
19 | # device. | 19 | # device. | |
20 | 20 | |||
21 | include "arch/x68k/conf/std.x68k" | 21 | include "arch/x68k/conf/std.x68k" | |
22 | 22 | |||
23 | options INCLUDE_CONFIG_FILE # embed config file in kernel binary | 23 | options INCLUDE_CONFIG_FILE # embed config file in kernel binary | |
24 | 24 | |||
25 | #ident "GENERIC-$Revision: 1.208 $" | 25 | #ident "GENERIC-$Revision: 1.209 $" | |
26 | 26 | |||
27 | makeoptions COPTS="-O2 -fno-reorder-blocks -fno-unwind-tables -fno-omit-frame-pointer" | 27 | makeoptions COPTS="-O2 -fno-reorder-blocks -fno-unwind-tables -fno-omit-frame-pointer" | |
28 | # See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for | 28 | # See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for | |
29 | # backtraces in DDB. | 29 | # backtraces in DDB. | |
30 | 30 | |||
31 | maxusers 8 | 31 | maxusers 8 | |
32 | 32 | |||
33 | ## System kernel configuration. See options(4) for more detail. | 33 | ## System kernel configuration. See options(4) for more detail. | |
34 | 34 | |||
35 | 35 | |||
36 | ## Options for variants of the m68k MPU | 36 | ## Options for variants of the m68k MPU | |
37 | ## you must have at least the correct one; REQUIRED | 37 | ## you must have at least the correct one; REQUIRED | |
38 | options M68030 | 38 | options M68030 | |
@@ -149,36 +149,36 @@ options DDB # kernel dynamic debugger | @@ -149,36 +149,36 @@ options DDB # kernel dynamic debugger | |||
149 | include "conf/compat_netbsd09.config" | 149 | include "conf/compat_netbsd09.config" | |
150 | 150 | |||
151 | options COMPAT_AOUT_M68K # compatibility with NetBSD/m68k a.out | 151 | options COMPAT_AOUT_M68K # compatibility with NetBSD/m68k a.out | |
152 | #options COMPAT_M68K4K # NetBSD/m68k4k binaries | 152 | #options COMPAT_M68K4K # NetBSD/m68k4k binaries | |
153 | #options COMPAT_SUNOS # SunOS 4.x binary compatibility; broken | 153 | #options COMPAT_SUNOS # SunOS 4.x binary compatibility; broken | |
154 | #options COMPAT_LINUX # Linux/m68k binary compatibility | 154 | #options COMPAT_LINUX # Linux/m68k binary compatibility | |
155 | #options COMPAT_OSSAUDIO # Linux/m68k binary compatibility | 155 | #options COMPAT_OSSAUDIO # Linux/m68k binary compatibility | |
156 | 156 | |||
157 | ## File systems. | 157 | ## File systems. | |
158 | file-system FFS # Berkeley Fast Filesystem | 158 | file-system FFS # Berkeley Fast Filesystem | |
159 | file-system NFS # Sun NFS-compatible filesystem client | 159 | file-system NFS # Sun NFS-compatible filesystem client | |
160 | file-system KERNFS # kernel data-structure filesystem | 160 | file-system KERNFS # kernel data-structure filesystem | |
161 | file-system NULLFS # NULL layered filesystem | 161 | file-system NULLFS # NULL layered filesystem | |
162 | #file-system OVERLAY # overlay file system | 162 | #file-system OVERLAY # overlay file system | |
163 | file-system MFS # memory-based filesystem | 163 | file-system MFS # memory-based filesystem | |
164 | #file-system FDESC # user file descriptor filesystem | 164 | #file-system FDESC # user file descriptor filesystem | |
165 | #file-system UMAPFS # uid/gid remapping filesystem | 165 | #file-system UMAPFS # uid/gid remapping filesystem | |
166 | #file-system LFS # Log-structured filesystem (experimental) | 166 | #file-system LFS # Log-structured filesystem (experimental) | |
167 | file-system PROCFS # /proc | 167 | file-system PROCFS # /proc | |
168 | file-system CD9660 # ISO 9660 + Rock Ridge file system | 168 | file-system CD9660 # ISO 9660 + Rock Ridge file system | |
169 | #file-system UNION # union file system (a little buggy) | 169 | #file-system UNION # union file system (a little buggy) | |
170 | file-system MSDOSFS # MS-DOS FAT filesystem(s). | 170 | file-system MSDOSFS # MS-DOS FAT filesystem(s). | |
171 | #file-system ADOSFS # AmigaDOS filesystem | 171 | #file-system ADOSFS # AmigaDOS filesystem | |
172 | file-system PTYFS # /dev/pts/N support | 172 | file-system PTYFS # /dev/pts/N support | |
173 | file-system TMPFS # Efficient memory file-system | 173 | file-system TMPFS # Efficient memory file-system | |
174 | #file-system UDF # experimental - OSTA UDF CD/DVD file-system | 174 | #file-system UDF # experimental - OSTA UDF CD/DVD file-system | |
175 | 175 | |||
176 | ## File system options. | 176 | ## File system options. | |
177 | #options FFS_EI # FFS Endian Independent support | 177 | #options FFS_EI # FFS Endian Independent support | |
178 | options FFS_NO_SNAPSHOT # No FFS snapshot support | 178 | options FFS_NO_SNAPSHOT # No FFS snapshot support | |
179 | #options QUOTA # legacy UFS quotas | 179 | #options QUOTA # legacy UFS quotas | |
180 | #options QUOTA2 # new, in-filesystem UFS quotas | 180 | #options QUOTA2 # new, in-filesystem UFS quotas | |
181 | #options UFS_DIRHASH # UFS Large Directory Hashing | 181 | #options UFS_DIRHASH # UFS Large Directory Hashing | |
182 | #options UFS_EXTATTR # Extended attribute support for UFS1 | 182 | #options UFS_EXTATTR # Extended attribute support for UFS1 | |
183 | options WAPBL # File system journaling support | 183 | options WAPBL # File system journaling support | |
184 | options NFSSERVER # Network File System server | 184 | options NFSSERVER # Network File System server | |
@@ -250,27 +250,27 @@ cd* at scsibus? target ? lun ? # SCSI CD | @@ -250,27 +250,27 @@ cd* at scsibus? target ? lun ? # SCSI CD | |||
250 | #ch* at scsibus? target ? lun ? # SCSI changer devices | 250 | #ch* at scsibus? target ? lun ? # SCSI changer devices | |
251 | #uk* at scsibus? target ? lun ? # SCSI unknown devices | 251 | #uk* at scsibus? target ? lun ? # SCSI unknown devices | |
252 | 252 | |||
253 | ## Ports | 253 | ## Ports | |
254 | zsc0 at intio0 addr 0xe98000 intr 112 | 254 | zsc0 at intio0 addr 0xe98000 intr 112 | |
255 | zstty0 at zsc0 channel 0 # built-in RS-232C | 255 | zstty0 at zsc0 channel 0 # built-in RS-232C | |
256 | ms0 at zsc0 channel 1 # standard mouse | 256 | ms0 at zsc0 channel 1 # standard mouse | |
257 | #zsc1 at intio0 addr 0xeafc00 intr 113 | 257 | #zsc1 at intio0 addr 0xeafc00 intr 113 | |
258 | #zstty2 at zsc1 channel 0 | 258 | #zstty2 at zsc1 channel 0 | |
259 | #zstty3 at zsc1 channel 1 | 259 | #zstty3 at zsc1 channel 1 | |
260 | #zsc2 at intio0 addr 0xeafc10 intr 114 | 260 | #zsc2 at intio0 addr 0xeafc10 intr 114 | |
261 | #zstty4 at zsc2 channel 0 | 261 | #zstty4 at zsc2 channel 0 | |
262 | #zstty5 at zsc2 channel 1 | 262 | #zstty5 at zsc2 channel 1 | |
263 | par0 at intio0 addr 0xe8c000 # Builtin printer port | 263 | par0 at intio0 addr 0xe8c000 # Builtin printer port | |
264 | 264 | |||
265 | sram0 at intio0 addr 0xed0000 # battery-backuped static RAM | 265 | sram0 at intio0 addr 0xed0000 # battery-backuped static RAM | |
266 | pseudo-device bell # OPM bell | 266 | pseudo-device bell # OPM bell | |
267 | 267 | |||
268 | powsw0 at mfp0 # Front switch | 268 | powsw0 at mfp0 # Front switch | |
269 | #powsw1 at mfp0 # External power switch | 269 | #powsw1 at mfp0 # External power switch | |
270 | 270 | |||
271 | com0 at intio0 addr 0xefff00 intr 240 # PSX16550, port1 | 271 | com0 at intio0 addr 0xefff00 intr 240 # PSX16550, port1 | |
272 | com1 at intio0 addr 0xefff10 intr 241 # PSX16550, port2 | 272 | com1 at intio0 addr 0xefff10 intr 241 # PSX16550, port2 | |
273 | 273 | |||
274 | ## Audio device | 274 | ## Audio device | |
275 | vs0 at intio0 addr 0xe92000 dma 3 dmaintr 106 | 275 | vs0 at intio0 addr 0xe92000 dma 3 dmaintr 106 | |
276 | audio* at vs? | 276 | audio* at vs? | |
@@ -401,72 +401,72 @@ bmd* at intio0 addr 0xecebf0 # Nereid | @@ -401,72 +401,72 @@ bmd* at intio0 addr 0xecebf0 # Nereid | |||
401 | #ugen* at uhub? port ? | 401 | #ugen* at uhub? port ? | |
402 | 402 | |||
403 | 403 | |||
404 | #### Pseudo devices | 404 | #### Pseudo devices | |
405 | 405 | |||
406 | # | 406 | # | |
407 | # accept filters | 407 | # accept filters | |
408 | #pseudo-device accf_data # "dataready" accept filter | 408 | #pseudo-device accf_data # "dataready" accept filter | |
409 | #pseudo-device accf_http # "httpready" accept filter | 409 | #pseudo-device accf_http # "httpready" accept filter | |
410 | 410 | |||
411 | ## A disk-like interface to files. Can be used to create floppy, CD, | 411 | ## A disk-like interface to files. Can be used to create floppy, CD, | |
412 | ## miniroot images, etc. | 412 | ## miniroot images, etc. | |
413 | 413 | |||
414 | pseudo-device vnd | 414 | pseudo-device vnd | |
415 | #options VND_COMPRESSION # compressed vnd(4) | 415 | #options VND_COMPRESSION # compressed vnd(4) | |
416 | 416 | |||
417 | ## Concatenated and striped disks; with this, you can create a software-based | 417 | ## Concatenated and striped disks; with this, you can create a software-based | |
418 | ## disk array similar to a "RAID 0" setup. See ccd(4). | 418 | ## disk array similar to a "RAID 0" setup. See ccd(4). | |
419 | 419 | |||
420 | #pseudo-device ccd | 420 | #pseudo-device ccd | |
421 | 421 | |||
422 | ## Cryptographic disk devices. See cgd(4). | 422 | ## Cryptographic disk devices. See cgd(4). | |
423 | 423 | |||
424 | #pseudo-device cgd | 424 | #pseudo-device cgd | |
425 | 425 | |||
426 | ## RAIDframe disk driver: software RAID driver. See raid(4). | 426 | ## RAIDframe disk driver: software RAID driver. See raid(4). | |
427 | 427 | |||
428 | pseudo-device raid | 428 | pseudo-device raid | |
429 | options RAID_AUTOCONFIG # auto-configuration of RAID components | 429 | options RAID_AUTOCONFIG # auto-configuration of RAID components | |
430 | # Options to enable various other RAIDframe RAID types. | 430 | # Options to enable various other RAIDframe RAID types. | |
431 | # options RF_INCLUDE_EVENODD=1 | 431 | # options RF_INCLUDE_EVENODD=1 | |
432 | # options RF_INCLUDE_RAID5_RS=1 | 432 | # options RF_INCLUDE_RAID5_RS=1 | |
433 | # options RF_INCLUDE_PARITYLOGGING=1 | 433 | # options RF_INCLUDE_PARITYLOGGING=1 | |
434 | # options RF_INCLUDE_CHAINDECLUSTER=1 | 434 | # options RF_INCLUDE_CHAINDECLUSTER=1 | |
435 | # options RF_INCLUDE_INTERDECLUSTER=1 | 435 | # options RF_INCLUDE_INTERDECLUSTER=1 | |
436 | # options RF_INCLUDE_PARITY_DECLUSTERING=1 | 436 | # options RF_INCLUDE_PARITY_DECLUSTERING=1 | |
437 | # options RF_INCLUDE_PARITY_DECLUSTERING_DS=1 | 437 | # options RF_INCLUDE_PARITY_DECLUSTERING_DS=1 | |
438 | 438 | |||
439 | 439 | |||
440 | ## Memory disk device, used on boot floppies with compressed | 440 | ## Memory disk device, used on boot floppies with compressed | |
441 | ## kernel-plus-root-disk images. | 441 | ## kernel-plus-root-disk images. | |
442 | 442 | |||
443 | #pseudo-device md | 443 | #pseudo-device md | |
444 | 444 | |||
445 | ## Loopback network interface; required | 445 | ## Loopback network interface; required | |
446 | pseudo-device loop | 446 | pseudo-device loop | |
447 | 447 | |||
448 | ## SLIP and CSLIP interfaces, for IP over a serial line. | 448 | ## SLIP and CSLIP interfaces, for IP over a serial line. | |
449 | pseudo-device sl | 449 | pseudo-device sl | |
450 | 450 | |||
451 | ## PPP, the successor to SLIP. See pppd(8). | 451 | ## PPP, the successor to SLIP. See pppd(8). | |
452 | pseudo-device ppp | 452 | pseudo-device ppp | |
453 | 453 | |||
454 | ## PPP over Ethernet (RFC 2516) | 454 | ## PPP over Ethernet (RFC 2516) | |
455 | pseudo-device pppoe | 455 | pseudo-device pppoe | |
456 | 456 | |||
457 | ## Network "tunnel" device, allowing protocol stacks to run in the userland. | 457 | ## Network "tunnel" device, allowing protocol stacks to run in the userland. | |
458 | ## This is used by the third-party user-mode "ppp" program, and others. | 458 | ## This is used by the third-party user-mode "ppp" program, and others. | |
459 | #pseudo-device tun | 459 | #pseudo-device tun | |
460 | #pseudo-device tap # virtual Ethernet | 460 | #pseudo-device tap # virtual Ethernet | |
461 | 461 | |||
462 | ## Generic L3 over IP tunnel | 462 | ## Generic L3 over IP tunnel | |
463 | #pseudo-device gre # generic L3 over IP tunnel | 463 | #pseudo-device gre # generic L3 over IP tunnel | |
464 | 464 | |||
465 | ## Berkeley Packet Filter, required to run RARPD. A generic C-language | 465 | ## Berkeley Packet Filter, required to run RARPD. A generic C-language | |
466 | ## interface that allows selective examining of incoming packets. | 466 | ## interface that allows selective examining of incoming packets. | |
467 | pseudo-device bpfilter | 467 | pseudo-device bpfilter | |
468 | 468 | |||
469 | #pseudo-device carp # Common Address Redundancy Protocol | 469 | #pseudo-device carp # Common Address Redundancy Protocol | |
470 | 470 | |||
471 | #pseudo-device npf # NPF packet filter | 471 | #pseudo-device npf # NPF packet filter | |
472 | 472 | |||
@@ -487,20 +487,20 @@ pseudo-device agr # IEEE 802.3ad link | @@ -487,20 +487,20 @@ pseudo-device agr # IEEE 802.3ad link | |||
487 | 487 | |||
488 | ## Pseudo ttys, required for network logins and programs like screen. | 488 | ## Pseudo ttys, required for network logins and programs like screen. | |
489 | 489 | |||
490 | pseudo-device pty # pseudo-terminals | 490 | pseudo-device pty # pseudo-terminals | |
491 | 491 | |||
492 | ## Random device, used to implement /dev/random (a source of random noise), | 492 | ## Random device, used to implement /dev/random (a source of random noise), | |
493 | ## and generate randomness for some kernel formulae. | 493 | ## and generate randomness for some kernel formulae. | |
494 | 494 | |||
495 | 495 | |||
496 | pseudo-device clockctl # user control of clock subsystem | 496 | pseudo-device clockctl # user control of clock subsystem | |
497 | pseudo-device drvctl # user control of drive subsystem | 497 | pseudo-device drvctl # user control of drive subsystem | |
498 | pseudo-device ksyms # /dev/ksyms | 498 | pseudo-device ksyms # /dev/ksyms | |
499 | #pseudo-device fss # file system snapshot device | 499 | #pseudo-device fss # file system snapshot device | |
500 | pseudo-device swwdog # software watchdog timer -- swwdog(4) | 500 | pseudo-device swwdog # software watchdog timer -- swwdog(4) | |
501 | 501 | |||
502 | # Veriexec | 502 | # Veriexec | |
503 | # include "dev/veriexec.config" | 503 | # include "dev/veriexec.config" | |
504 | 504 | |||
505 | # Pull in optional local configuration - always at end | 505 | # Pull in optional local configuration - always at end | |
506 | cinclude "arch/x68k/conf/GENERIC.local" | 506 | cinclude "arch/x68k/conf/GENERIC.local" |
--- src/sys/arch/x68k/conf/INSTALL 2022/06/11 04:57:57 1.121
+++ src/sys/arch/x68k/conf/INSTALL 2024/01/07 07:58:33 1.122
@@ -1,24 +1,24 @@ | @@ -1,24 +1,24 @@ | |||
1 | # $NetBSD: INSTALL,v 1.121 2022/06/11 04:57:57 tsutsui Exp $ | 1 | # $NetBSD: INSTALL,v 1.122 2024/01/07 07:58:33 isaki Exp $ | |
2 | 2 | |||
3 | # | 3 | # | |
4 | # INSTALL -- installation kernel. | 4 | # INSTALL -- installation kernel. | |
5 | # | 5 | # | |
6 | 6 | |||
7 | include "arch/x68k/conf/std.x68k" | 7 | include "arch/x68k/conf/std.x68k" | |
8 | 8 | |||
9 | #options INCLUDE_CONFIG_FILE # embed config file in kernel binary | 9 | #options INCLUDE_CONFIG_FILE # embed config file in kernel binary | |
10 | 10 | |||
11 | #ident "INSTALL-$Revision: 1.121 $" | 11 | #ident "INSTALL-$Revision: 1.122 $" | |
12 | 12 | |||
13 | makeoptions COPTS="-Os -fno-unwind-tables" # Optimise for space. Implies -O2 | 13 | makeoptions COPTS="-Os -fno-unwind-tables" # Optimise for space. Implies -O2 | |
14 | 14 | |||
15 | maxusers 4 | 15 | maxusers 4 | |
16 | 16 | |||
17 | ## Enable the hooks used for initializing the memory-disk. | 17 | ## Enable the hooks used for initializing the memory-disk. | |
18 | options MEMORY_DISK_HOOKS | 18 | options MEMORY_DISK_HOOKS | |
19 | options MEMORY_DISK_IS_ROOT # Force root on memory-disk | 19 | options MEMORY_DISK_IS_ROOT # Force root on memory-disk | |
20 | options MEMORY_DISK_SERVER=0 # No user space hooks | 20 | options MEMORY_DISK_SERVER=0 # No user space hooks | |
21 | options MEMORY_DISK_ROOT_SIZE=3600 # size of memory disk, in blocks | 21 | options MEMORY_DISK_ROOT_SIZE=3600 # size of memory disk, in blocks | |
22 | options MEMORY_DISK_RBFLAGS=RB_SINGLE # boot in single-user mode | 22 | options MEMORY_DISK_RBFLAGS=RB_SINGLE # boot in single-user mode | |
23 | 23 | |||
24 | ## System kernel configuration. See options(4) for more detail. | 24 | ## System kernel configuration. See options(4) for more detail. | |
@@ -131,36 +131,36 @@ options PIPE_SOCKETPAIR # smaller, but | @@ -131,36 +131,36 @@ options PIPE_SOCKETPAIR # smaller, but | |||
131 | include "conf/compat_netbsd30.config" | 131 | include "conf/compat_netbsd30.config" | |
132 | 132 | |||
133 | #options COMPAT_AOUT_M68K # compatibility with NetBSD/m68k a.out | 133 | #options COMPAT_AOUT_M68K # compatibility with NetBSD/m68k a.out | |
134 | #options COMPAT_M68K4K # NetBSD/m68k4k binaries | 134 | #options COMPAT_M68K4K # NetBSD/m68k4k binaries | |
135 | #options COMPAT_SUNOS # SunOS 4.x binary compatibility; broken | 135 | #options COMPAT_SUNOS # SunOS 4.x binary compatibility; broken | |
136 | #options COMPAT_LINUX # Linux/m68k binary compatibility | 136 | #options COMPAT_LINUX # Linux/m68k binary compatibility | |
137 | #options COMPAT_OSSAUDIO # Linux/m68k binary compatibility | 137 | #options COMPAT_OSSAUDIO # Linux/m68k binary compatibility | |
138 | 138 | |||
139 | ## File systems. | 139 | ## File systems. | |
140 | file-system FFS # Berkeley Fast Filesystem | 140 | file-system FFS # Berkeley Fast Filesystem | |
141 | file-system NFS # Sun NFS-compatible filesystem client | 141 | file-system NFS # Sun NFS-compatible filesystem client | |
142 | #file-system KERNFS # kernel data-structure filesystem | 142 | #file-system KERNFS # kernel data-structure filesystem | |
143 | #file-system NULLFS # NULL layered filesystem | 143 | #file-system NULLFS # NULL layered filesystem | |
144 | #file-system OVERLAY # overlay file system | 144 | #file-system OVERLAY # overlay file system | |
145 | #file-system MFS # memory-based filesystem | 145 | #file-system MFS # memory-based filesystem | |
146 | #file-system FDESC # user file descriptor filesystem | 146 | #file-system FDESC # user file descriptor filesystem | |
147 | #file-system UMAPFS # uid/gid remapping filesystem | 147 | #file-system UMAPFS # uid/gid remapping filesystem | |
148 | #file-system LFS # Log-structured filesystem (experimental) | 148 | #file-system LFS # Log-structured filesystem (experimental) | |
149 | #file-system PROCFS # /proc | 149 | #file-system PROCFS # /proc | |
150 | file-system CD9660 # ISO 9660 + Rock Ridge file system | 150 | file-system CD9660 # ISO 9660 + Rock Ridge file system | |
151 | #file-system UNION # union file system (a little buggy) | 151 | #file-system UNION # union file system (a little buggy) | |
152 | file-system MSDOSFS # MS-DOS FAT filesystem(s). | 152 | file-system MSDOSFS # MS-DOS FAT filesystem(s). | |
153 | #file-system ADOSFS # AmigaDOS filesystem | 153 | #file-system ADOSFS # AmigaDOS filesystem | |
154 | #file-system PTYFS # /dev/pts/N support | 154 | #file-system PTYFS # /dev/pts/N support | |
155 | 155 | |||
156 | ## File system options. | 156 | ## File system options. | |
157 | #options NFSSERVER # Sun NFS-compatible filesystem server | 157 | #options NFSSERVER # Sun NFS-compatible filesystem server | |
158 | #options QUOTA # legacy UFS quotas | 158 | #options QUOTA # legacy UFS quotas | |
159 | #options QUOTA2 # new, in-filesystem UFS quotas | 159 | #options QUOTA2 # new, in-filesystem UFS quotas | |
160 | #options FFS_EI # FFS Endian Independent support | 160 | #options FFS_EI # FFS Endian Independent support | |
161 | options WAPBL # File system journaling support | 161 | options WAPBL # File system journaling support | |
162 | #options NFS_V2_ONLY # Exclude NFS3 code to save space | 162 | #options NFS_V2_ONLY # Exclude NFS3 code to save space | |
163 | options FFS_NO_SNAPSHOT # No FFS snapshot support | 163 | options FFS_NO_SNAPSHOT # No FFS snapshot support | |
164 | 164 | |||
165 | ## Network protocol support. In most environments, INET is required. | 165 | ## Network protocol support. In most environments, INET is required. | |
166 | options INET # IP (Internet Protocol) v4 | 166 | options INET # IP (Internet Protocol) v4 | |
@@ -215,42 +215,42 @@ st* at scsibus? target ? lun ? # SCSI ta | @@ -215,42 +215,42 @@ st* at scsibus? target ? lun ? # SCSI ta | |||
215 | #ch* at scsibus? target ? lun ? # SCSI changer devices | 215 | #ch* at scsibus? target ? lun ? # SCSI changer devices | |
216 | #uk* at scsibus? target ? lun ? # SCSI unknown devices | 216 | #uk* at scsibus? target ? lun ? # SCSI unknown devices | |
217 | 217 | |||
218 | ## Ports | 218 | ## Ports | |
219 | zsc0 at intio0 addr 0xe98000 intr 112 | 219 | zsc0 at intio0 addr 0xe98000 intr 112 | |
220 | zstty0 at zsc0 channel 0 # built-in RS-232C | 220 | zstty0 at zsc0 channel 0 # built-in RS-232C | |
221 | #ms0 at zsc0 channel 1 # standard mouse | 221 | #ms0 at zsc0 channel 1 # standard mouse | |
222 | #zsc1 at intio0 addr 0xeafc00 intr 113 | 222 | #zsc1 at intio0 addr 0xeafc00 intr 113 | |
223 | #zstty2 at zsc1 channel 0 | 223 | #zstty2 at zsc1 channel 0 | |
224 | #zstty3 at zsc1 channel 1 | 224 | #zstty3 at zsc1 channel 1 | |
225 | #zsc2 at intio0 addr 0xeafc10 intr 114 | 225 | #zsc2 at intio0 addr 0xeafc10 intr 114 | |
226 | #zstty4 at zsc2 channel 0 | 226 | #zstty4 at zsc2 channel 0 | |
227 | #zstty5 at zsc2 channel 1 | 227 | #zstty5 at zsc2 channel 1 | |
228 | #par0 at intio0 addr 0xe8c000 # Builtin printer port | 228 | #par0 at intio0 addr 0xe8c000 # Builtin printer port | |
229 | 229 | |||
230 | sram0 at intio0 addr 0xed0000 # battery-backuped static RAM | 230 | sram0 at intio0 addr 0xed0000 # battery-backuped static RAM | |
231 | #pseudo-device bell # OPM bell | 231 | #pseudo-device bell # OPM bell | |
232 | 232 | |||
233 | #com0 at intio0 addr 0xefff00 intr 240 # PSX16550, port1 | 233 | #com0 at intio0 addr 0xefff00 intr 240 # PSX16550, port1 | |
234 | #com1 at intio0 addr 0xefff10 intr 241 # PSX16550, port2 | 234 | #com1 at intio0 addr 0xefff10 intr 241 # PSX16550, port2 | |
235 | 235 | |||
236 | ## Audio device | 236 | ## Audio device | |
237 | #vs0 at intio0 addr 0xe92000 dma 3 dmaintr 106 | 237 | #vs0 at intio0 addr 0xe92000 dma 3 dmaintr 106 | |
238 | #audio* at vs? | 238 | #audio* at vs? | |
239 | 239 | |||
240 | #spkr* at audio? # PC speaker (synthesized) | 240 | #spkr* at audio? # PC speaker (synthesized) | |
241 | 241 | |||
242 | ## Network interfaces | 242 | ## Network interfaces | |
243 | ne* at intio0 addr 0xece300 intr 249 # Nereid Ethernet | 243 | ne* at intio0 addr 0xece300 intr 249 # Nereid Ethernet | |
244 | ne* at intio0 addr 0xeceb00 intr 248 # Nereid Ethernet | 244 | ne* at intio0 addr 0xeceb00 intr 248 # Nereid Ethernet | |
245 | neptune0 at intio0 addr 0xece000 intr 249 # Neptune-X | 245 | neptune0 at intio0 addr 0xece000 intr 249 # Neptune-X | |
246 | neptune1 at intio0 addr 0xece400 intr 249 # Neptune-X at alt. addr. | 246 | neptune1 at intio0 addr 0xece400 intr 249 # Neptune-X at alt. addr. | |
247 | ne* at neptune? addr 0x300 # NE2000 or clone | 247 | ne* at neptune? addr 0x300 # NE2000 or clone | |
248 | 248 | |||
249 | 249 | |||
250 | #### Pseudo devices | 250 | #### Pseudo devices | |
251 | 251 | |||
252 | pseudo-device md # boot floppy image | 252 | pseudo-device md # boot floppy image | |
253 | pseudo-device loop | 253 | pseudo-device loop | |
254 | pseudo-device bpfilter | 254 | pseudo-device bpfilter | |
255 | pseudo-device sl | 255 | pseudo-device sl | |
256 | pseudo-device pty # pseudo-terminals | 256 | pseudo-device pty # pseudo-terminals |
--- src/sys/arch/x68k/conf/majors.x68k 2021/06/29 10:22:37 1.33
+++ src/sys/arch/x68k/conf/majors.x68k 2024/01/07 07:58:33 1.34
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: majors.x68k,v 1.33 2021/06/29 10:22:37 nia Exp $ | 1 | # $NetBSD: majors.x68k,v 1.34 2024/01/07 07:58:33 isaki Exp $ | |
2 | # | 2 | # | |
3 | # Device majors for x68k | 3 | # Device majors for x68k | |
4 | # | 4 | # | |
5 | 5 | |||
6 | device-major cons char 0 | 6 | device-major cons char 0 | |
7 | device-major ctty char 1 | 7 | device-major ctty char 1 | |
8 | device-major mem char 2 | 8 | device-major mem char 2 | |
9 | device-major swap char 3 block 3 vmswap | 9 | device-major swap char 3 block 3 vmswap | |
10 | device-major pts char 4 pty | 10 | device-major pts char 4 pty | |
11 | device-major ptc char 5 pty | 11 | device-major ptc char 5 pty | |
12 | device-major log char 6 | 12 | device-major log char 6 | |
13 | device-major md char 7 block 8 md | 13 | device-major md char 7 block 8 md | |
14 | device-major sd char 8 block 4 sd | 14 | device-major sd char 8 block 4 sd | |
@@ -53,15 +53,15 @@ device-major ugen char 51 ugen | @@ -53,15 +53,15 @@ device-major ugen char 51 ugen | |||
53 | device-major cgd char 52 block 17 cgd | 53 | device-major cgd char 52 block 17 cgd | |
54 | device-major bmd char 53 block 18 bmd | 54 | device-major bmd char 53 block 18 bmd | |
55 | device-major ksyms char 54 ksyms | 55 | device-major ksyms char 54 ksyms | |
56 | device-major ses char 55 ses | 56 | device-major ses char 55 ses | |
57 | device-major uhid char 56 uhid | 57 | device-major uhid char 56 uhid | |
58 | device-major ulpt char 57 ulpt | 58 | device-major ulpt char 57 ulpt | |
59 | device-major ucom char 58 ucom | 59 | device-major ucom char 58 ucom | |
60 | #device-major obsolete char 59 obsolete (urio) | 60 | #device-major obsolete char 59 obsolete (urio) | |
61 | #device-major obsolete char 60 obsolete (uscanner) | 61 | #device-major obsolete char 60 obsolete (uscanner) | |
62 | device-major sysmon char 61 sysmon | 62 | device-major sysmon char 61 sysmon | |
63 | #device-major obsolete char 98 obsolete (nsmb) | 63 | #device-major obsolete char 98 obsolete (nsmb) | |
64 | 64 | |||
65 | # Majors up to 143 are reserved for machine-dependent drivers. | 65 | # Majors up to 143 are reserved for machine-dependent drivers. | |
66 | # New machine-independent driver majors are assigned in | 66 | # New machine-independent driver majors are assigned in | |
67 | # sys/conf/majors. | 67 | # sys/conf/majors. |
--- src/sys/arch/x68k/dev/bmd.c 2023/12/17 21:51:29 1.27
+++ src/sys/arch/x68k/dev/bmd.c 2024/01/07 07:58:33 1.28
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bmd.c,v 1.27 2023/12/17 21:51:29 andvar Exp $ */ | 1 | /* $NetBSD: bmd.c,v 1.28 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2002 Tetsuya Isaki. All rights reserved. | 4 | * Copyright (c) 2002 Tetsuya Isaki. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | * SUCH DAMAGE. | 25 | * SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | /* | 28 | /* | |
29 | * Nereid bank memory disk | 29 | * Nereid bank memory disk | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: bmd.c,v 1.27 2023/12/17 21:51:29 andvar Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: bmd.c,v 1.28 2024/01/07 07:58:33 isaki Exp $"); | |
34 | 34 | |||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> | |
36 | #include <sys/systm.h> | 36 | #include <sys/systm.h> | |
37 | #include <sys/buf.h> | 37 | #include <sys/buf.h> | |
38 | #include <sys/conf.h> | 38 | #include <sys/conf.h> | |
39 | #include <sys/device.h> | 39 | #include <sys/device.h> | |
40 | #include <sys/kernel.h> | 40 | #include <sys/kernel.h> | |
41 | #include <sys/stat.h> | 41 | #include <sys/stat.h> | |
42 | #include <sys/disk.h> | 42 | #include <sys/disk.h> | |
43 | #include <sys/disklabel.h> | 43 | #include <sys/disklabel.h> | |
44 | #include <sys/ioctl.h> | 44 | #include <sys/ioctl.h> | |
45 | #include <sys/fcntl.h> | 45 | #include <sys/fcntl.h> | |
46 | #include <sys/proc.h> | 46 | #include <sys/proc.h> | |
@@ -142,27 +142,27 @@ bmd_match(device_t parent, cfdata_t cf, | @@ -142,27 +142,27 @@ bmd_match(device_t parent, cfdata_t cf, | |||
142 | bus_space_tag_t iot = ia->ia_bst; | 142 | bus_space_tag_t iot = ia->ia_bst; | |
143 | bus_space_handle_t ioh; | 143 | bus_space_handle_t ioh; | |
144 | int window; | 144 | int window; | |
145 | int r; | 145 | int r; | |
146 | 146 | |||
147 | if (ia->ia_addr == INTIOCF_ADDR_DEFAULT) | 147 | if (ia->ia_addr == INTIOCF_ADDR_DEFAULT) | |
148 | ia->ia_addr = BMD_ADDR1; | 148 | ia->ia_addr = BMD_ADDR1; | |
149 | 149 | |||
150 | /* fixed parameter */ | 150 | /* fixed parameter */ | |
151 | if (ia->ia_addr != BMD_ADDR1 && ia->ia_addr != BMD_ADDR2) | 151 | if (ia->ia_addr != BMD_ADDR1 && ia->ia_addr != BMD_ADDR2) | |
152 | return (0); | 152 | return (0); | |
153 | 153 | |||
154 | /* Check CTRL addr */ | 154 | /* Check CTRL addr */ | |
155 | if (badaddr((void *)IIOV(ia->ia_addr))) | 155 | if (badaddr((void *)IIOV(ia->ia_addr))) | |
156 | return (0); | 156 | return (0); | |
157 | 157 | |||
158 | ia->ia_size = 2; | 158 | ia->ia_size = 2; | |
159 | if (bus_space_map(iot, ia->ia_addr, ia->ia_size, 0, &ioh)) | 159 | if (bus_space_map(iot, ia->ia_addr, ia->ia_size, 0, &ioh)) | |
160 | return (0); | 160 | return (0); | |
161 | 161 | |||
162 | /* Check window addr */ | 162 | /* Check window addr */ | |
163 | r = bus_space_read_1(iot, ioh, BMD_CTRL); | 163 | r = bus_space_read_1(iot, ioh, BMD_CTRL); | |
164 | bus_space_unmap(iot, ioh, ia->ia_size); | 164 | bus_space_unmap(iot, ioh, ia->ia_size); | |
165 | 165 | |||
166 | if ((r & BMD_CTRL_WINDOW)) | 166 | if ((r & BMD_CTRL_WINDOW)) | |
167 | window = 0xef0000; | 167 | window = 0xef0000; | |
168 | else | 168 | else |
--- src/sys/arch/x68k/dev/fd.c 2023/12/17 21:52:11 1.128
+++ src/sys/arch/x68k/dev/fd.c 2024/01/07 07:58:33 1.129
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fd.c,v 1.128 2023/12/17 21:52:11 andvar Exp $ */ | 1 | /* $NetBSD: fd.c,v 1.129 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Charles M. Hannum and Minoura Makoto. | 8 | * by Charles M. Hannum and Minoura Makoto. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -54,27 +54,27 @@ | @@ -54,27 +54,27 @@ | |||
54 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 54 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
55 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 55 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
56 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 56 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
57 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 57 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
61 | * SUCH DAMAGE. | 61 | * SUCH DAMAGE. | |
62 | * | 62 | * | |
63 | * @(#)fd.c 7.4 (Berkeley) 5/25/91 | 63 | * @(#)fd.c 7.4 (Berkeley) 5/25/91 | |
64 | */ | 64 | */ | |
65 | 65 | |||
66 | #include <sys/cdefs.h> | 66 | #include <sys/cdefs.h> | |
67 | __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.128 2023/12/17 21:52:11 andvar Exp $"); | 67 | __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.129 2024/01/07 07:58:33 isaki Exp $"); | |
68 | 68 | |||
69 | #include "opt_ddb.h" | 69 | #include "opt_ddb.h" | |
70 | #include "opt_m68k_arch.h" | 70 | #include "opt_m68k_arch.h" | |
71 | 71 | |||
72 | #include <sys/param.h> | 72 | #include <sys/param.h> | |
73 | #include <sys/systm.h> | 73 | #include <sys/systm.h> | |
74 | #include <sys/bus.h> | 74 | #include <sys/bus.h> | |
75 | #include <sys/callout.h> | 75 | #include <sys/callout.h> | |
76 | #include <sys/kernel.h> | 76 | #include <sys/kernel.h> | |
77 | #include <sys/conf.h> | 77 | #include <sys/conf.h> | |
78 | #include <sys/file.h> | 78 | #include <sys/file.h> | |
79 | #include <sys/stat.h> | 79 | #include <sys/stat.h> | |
80 | #include <sys/ioctl.h> | 80 | #include <sys/ioctl.h> | |
@@ -1758,27 +1758,27 @@ fdioctl(dev_t dev, u_long cmd, void *add | @@ -1758,27 +1758,27 @@ fdioctl(dev_t dev, u_long cmd, void *add | |||
1758 | fd_formb->fd_formb_secno(i) = il[i + 1]; | 1758 | fd_formb->fd_formb_secno(i) = il[i + 1]; | |
1759 | fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize; | 1759 | fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize; | |
1760 | } | 1760 | } | |
1761 | 1761 | |||
1762 | error = fdformat(dev, fd_formb, l); | 1762 | error = fdformat(dev, fd_formb, l); | |
1763 | free(fd_formb, M_TEMP); | 1763 | free(fd_formb, M_TEMP); | |
1764 | return error; | 1764 | return error; | |
1765 | 1765 | |||
1766 | case FDIOCGETOPTS: /* get drive options */ | 1766 | case FDIOCGETOPTS: /* get drive options */ | |
1767 | DPRINTF(("FDIOCGETOPTS\n")); | 1767 | DPRINTF(("FDIOCGETOPTS\n")); | |
1768 | *(int *)addr = fd->sc_opts; | 1768 | *(int *)addr = fd->sc_opts; | |
1769 | return 0; | 1769 | return 0; | |
1770 | 1770 | |||
1771 | case FDIOCSETOPTS: /* set drive options */ | 1771 | case FDIOCSETOPTS: /* set drive options */ | |
1772 | DPRINTF(("FDIOCSETOPTS\n")); | 1772 | DPRINTF(("FDIOCSETOPTS\n")); | |
1773 | fd->sc_opts = *(int *)addr; | 1773 | fd->sc_opts = *(int *)addr; | |
1774 | return 0; | 1774 | return 0; | |
1775 | 1775 | |||
1776 | case DIOCLOCK: | 1776 | case DIOCLOCK: | |
1777 | /* | 1777 | /* | |
1778 | * Nothing to do here, really. | 1778 | * Nothing to do here, really. | |
1779 | */ | 1779 | */ | |
1780 | return 0; /* XXX */ | 1780 | return 0; /* XXX */ | |
1781 | 1781 | |||
1782 | case DIOCEJECT: | 1782 | case DIOCEJECT: | |
1783 | DPRINTF(("DIOCEJECT\n")); | 1783 | DPRINTF(("DIOCEJECT\n")); | |
1784 | if (*(int *)addr == 0) { | 1784 | if (*(int *)addr == 0) { | |
@@ -1872,27 +1872,27 @@ fdgetdisklabel(struct fd_softc *sc, dev_ | @@ -1872,27 +1872,27 @@ fdgetdisklabel(struct fd_softc *sc, dev_ | |||
1872 | 1872 | |||
1873 | part = DISKPART(dev); | 1873 | part = DISKPART(dev); | |
1874 | lp = sc->sc_dk.dk_label; | 1874 | lp = sc->sc_dk.dk_label; | |
1875 | memset(lp, 0, sizeof(struct disklabel)); | 1875 | memset(lp, 0, sizeof(struct disklabel)); | |
1876 | 1876 | |||
1877 | lp->d_secsize = 128 << sc->sc_type->secsize; | 1877 | lp->d_secsize = 128 << sc->sc_type->secsize; | |
1878 | lp->d_ntracks = sc->sc_type->heads; | 1878 | lp->d_ntracks = sc->sc_type->heads; | |
1879 | lp->d_nsectors = sc->sc_type->sectrac; | 1879 | lp->d_nsectors = sc->sc_type->sectrac; | |
1880 | lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors; | 1880 | lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors; | |
1881 | lp->d_ncylinders = sc->sc_type->size / lp->d_secpercyl; | 1881 | lp->d_ncylinders = sc->sc_type->size / lp->d_secpercyl; | |
1882 | lp->d_secperunit = sc->sc_type->size; | 1882 | lp->d_secperunit = sc->sc_type->size; | |
1883 | 1883 | |||
1884 | lp->d_type = DKTYPE_FLOPPY; | 1884 | lp->d_type = DKTYPE_FLOPPY; | |
1885 | lp->d_rpm = 300; /* XXX */ | 1885 | lp->d_rpm = 300; /* XXX */ | |
1886 | lp->d_interleave = 1; /* FIXME: is this OK? */ | 1886 | lp->d_interleave = 1; /* FIXME: is this OK? */ | |
1887 | lp->d_bbsize = 0; | 1887 | lp->d_bbsize = 0; | |
1888 | lp->d_sbsize = 0; | 1888 | lp->d_sbsize = 0; | |
1889 | lp->d_npartitions = part + 1; | 1889 | lp->d_npartitions = part + 1; | |
1890 | #define STEP_DELAY 6000 /* 6ms (6000us) delay after stepping */ | 1890 | #define STEP_DELAY 6000 /* 6ms (6000us) delay after stepping */ | |
1891 | lp->d_trkseek = STEP_DELAY; /* XXX */ | 1891 | lp->d_trkseek = STEP_DELAY; /* XXX */ | |
1892 | lp->d_magic = DISKMAGIC; | 1892 | lp->d_magic = DISKMAGIC; | |
1893 | lp->d_magic2 = DISKMAGIC; | 1893 | lp->d_magic2 = DISKMAGIC; | |
1894 | lp->d_checksum = dkcksum(lp); | 1894 | lp->d_checksum = dkcksum(lp); | |
1895 | lp->d_partitions[part].p_size = lp->d_secperunit; | 1895 | lp->d_partitions[part].p_size = lp->d_secperunit; | |
1896 | lp->d_partitions[part].p_fstype = FS_UNUSED; | 1896 | lp->d_partitions[part].p_fstype = FS_UNUSED; | |
1897 | lp->d_partitions[part].p_fsize = 1024; | 1897 | lp->d_partitions[part].p_fsize = 1024; | |
1898 | lp->d_partitions[part].p_frag = 8; | 1898 | lp->d_partitions[part].p_frag = 8; |
--- src/sys/arch/x68k/dev/intio_dmac.c 2023/12/17 22:03:50 1.39
+++ src/sys/arch/x68k/dev/intio_dmac.c 2024/01/07 07:58:33 1.40
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: intio_dmac.c,v 1.39 2023/12/17 22:03:50 andvar Exp $ */ | 1 | /* $NetBSD: intio_dmac.c,v 1.40 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Minoura Makoto. | 8 | * by Minoura Makoto. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * Hitachi HD63450 (= Motorola MC68450) DMAC driver for x68k. | 33 | * Hitachi HD63450 (= Motorola MC68450) DMAC driver for x68k. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include "opt_m68k_arch.h" | 36 | #include "opt_m68k_arch.h" | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.39 2023/12/17 22:03:50 andvar Exp $"); | 39 | __KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.40 2024/01/07 07:58:33 isaki Exp $"); | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/systm.h> | 42 | #include <sys/systm.h> | |
43 | #include <sys/device.h> | 43 | #include <sys/device.h> | |
44 | #include <uvm/uvm_extern.h> | 44 | #include <uvm/uvm_extern.h> | |
45 | 45 | |||
46 | #include <machine/bus.h> | 46 | #include <machine/bus.h> | |
47 | #include <machine/cpu.h> | 47 | #include <machine/cpu.h> | |
48 | #include <machine/frame.h> | 48 | #include <machine/frame.h> | |
49 | 49 | |||
50 | #include <arch/x68k/dev/intiovar.h> | 50 | #include <arch/x68k/dev/intiovar.h> | |
51 | #include <arch/x68k/dev/dmacvar.h> | 51 | #include <arch/x68k/dev/dmacvar.h> | |
52 | 52 | |||
@@ -170,27 +170,27 @@ dmac_alloc_channel(device_t self, int ch | @@ -170,27 +170,27 @@ dmac_alloc_channel(device_t self, int ch | |||
170 | #ifdef DMAC_ARRAYCHAIN | 170 | #ifdef DMAC_ARRAYCHAIN | |
171 | int r, dummy; | 171 | int r, dummy; | |
172 | #endif | 172 | #endif | |
173 | 173 | |||
174 | aprint_normal_dev(dmac->sc_dev, "allocating ch %d for %s.\n", | 174 | aprint_normal_dev(dmac->sc_dev, "allocating ch %d for %s.\n", | |
175 | ch, name); | 175 | ch, name); | |
176 | DPRINTF(3, ("dmamap=%p\n", (void *)chan->ch_xfer.dx_dmamap)); | 176 | DPRINTF(3, ("dmamap=%p\n", (void *)chan->ch_xfer.dx_dmamap)); | |
177 | #ifdef DIAGNOSTIC | 177 | #ifdef DIAGNOSTIC | |
178 | if (ch < 0 || ch >= DMAC_NCHAN) | 178 | if (ch < 0 || ch >= DMAC_NCHAN) | |
179 | panic("Invalid DMAC channel."); | 179 | panic("Invalid DMAC channel."); | |
180 | if (chan->ch_name[0]) | 180 | if (chan->ch_name[0]) | |
181 | panic("DMAC: channel in use."); | 181 | panic("DMAC: channel in use."); | |
182 | if (strlen(name) > 8) | 182 | if (strlen(name) > 8) | |
183 | panic("DMAC: wrong user name."); | 183 | panic("DMAC: wrong user name."); | |
184 | #endif | 184 | #endif | |
185 | 185 | |||
186 | #ifdef DMAC_ARRAYCHAIN | 186 | #ifdef DMAC_ARRAYCHAIN | |
187 | /* allocate the DMAC arraychaining map */ | 187 | /* allocate the DMAC arraychaining map */ | |
188 | r = bus_dmamem_alloc(intio->sc_dmat, | 188 | r = bus_dmamem_alloc(intio->sc_dmat, | |
189 | sizeof(struct dmac_sg_array) * DMAC_MAPSIZE, | 189 | sizeof(struct dmac_sg_array) * DMAC_MAPSIZE, | |
190 | 4, 0, &chan->ch_seg[0], 1, &dummy, | 190 | 4, 0, &chan->ch_seg[0], 1, &dummy, | |
191 | BUS_DMA_NOWAIT); | 191 | BUS_DMA_NOWAIT); | |
192 | if (r) | 192 | if (r) | |
193 | panic("DMAC: cannot alloc DMA safe memory"); | 193 | panic("DMAC: cannot alloc DMA safe memory"); | |
194 | r = bus_dmamem_map(intio->sc_dmat, | 194 | r = bus_dmamem_map(intio->sc_dmat, | |
195 | &chan->ch_seg[0], 1, | 195 | &chan->ch_seg[0], 1, | |
196 | sizeof(struct dmac_sg_array) * DMAC_MAPSIZE, | 196 | sizeof(struct dmac_sg_array) * DMAC_MAPSIZE, | |
@@ -370,27 +370,27 @@ dmac_start_xfer_offset(struct dmac_softc | @@ -370,27 +370,27 @@ dmac_start_xfer_offset(struct dmac_softc | |||
370 | } | 370 | } | |
371 | 371 | |||
372 | #ifdef DMAC_ARRAYCHAIN | 372 | #ifdef DMAC_ARRAYCHAIN | |
373 | #ifdef DIAGNOSTIC | 373 | #ifdef DIAGNOSTIC | |
374 | if (xf->dx_done) | 374 | if (xf->dx_done) | |
375 | panic("dmac_start_xfer: DMA transfer in progress"); | 375 | panic("dmac_start_xfer: DMA transfer in progress"); | |
376 | #endif | 376 | #endif | |
377 | #endif | 377 | #endif | |
378 | DPRINTF(3, ("First program:\n")); | 378 | DPRINTF(3, ("First program:\n")); | |
379 | #ifdef DIAGNOSTIC | 379 | #ifdef DIAGNOSTIC | |
380 | if ((offset >= dmamap->dm_mapsize) || | 380 | if ((offset >= dmamap->dm_mapsize) || | |
381 | (offset + size > dmamap->dm_mapsize)) | 381 | (offset + size > dmamap->dm_mapsize)) | |
382 | panic("dmac_start_xfer_offset: invalid offset: " | 382 | panic("dmac_start_xfer_offset: invalid offset: " | |
383 | "offset=%d, size=%d, mapsize=%ld", | 383 | "offset=%d, size=%d, mapsize=%ld", | |
384 | offset, size, dmamap->dm_mapsize); | 384 | offset, size, dmamap->dm_mapsize); | |
385 | #endif | 385 | #endif | |
386 | /* program DMAC in single block mode or array chainning mode */ | 386 | /* program DMAC in single block mode or array chainning mode */ | |
387 | if (dmamap->dm_nsegs == 1) { | 387 | if (dmamap->dm_nsegs == 1) { | |
388 | DPRINTF(3, ("single block mode\n")); | 388 | DPRINTF(3, ("single block mode\n")); | |
389 | #ifdef DIAGNOSTIC | 389 | #ifdef DIAGNOSTIC | |
390 | if (dmamap->dm_mapsize != dmamap->dm_segs[0].ds_len) | 390 | if (dmamap->dm_mapsize != dmamap->dm_segs[0].ds_len) | |
391 | panic("dmac_start_xfer_offset: dmamap curruption"); | 391 | panic("dmac_start_xfer_offset: dmamap curruption"); | |
392 | #endif | 392 | #endif | |
393 | paddr = dmamap->dm_segs[0].ds_addr + offset; | 393 | paddr = dmamap->dm_segs[0].ds_addr + offset; | |
394 | csr = bus_space_read_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CSR); | 394 | csr = bus_space_read_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CSR); | |
395 | if ((csr & DMAC_CSR_ACT) != 0) { | 395 | if ((csr & DMAC_CSR_ACT) != 0) { | |
396 | /* Use 'Continue Mode' */ | 396 | /* Use 'Continue Mode' */ |
--- src/sys/arch/x68k/dev/ite.c 2022/06/25 05:01:31 1.70
+++ src/sys/arch/x68k/dev/ite.c 2024/01/07 07:58:33 1.71
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ite.c,v 1.70 2022/06/25 05:01:31 tsutsui Exp $ */ | 1 | /* $NetBSD: ite.c,v 1.71 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988 University of Utah. | 4 | * Copyright (c) 1988 University of Utah. | |
5 | * Copyright (c) 1990 The Regents of the University of California. | 5 | * Copyright (c) 1990 The Regents of the University of California. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department. | 10 | * Science Department. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -35,27 +35,27 @@ | @@ -35,27 +35,27 @@ | |||
35 | * | 35 | * | |
36 | * from: Utah $Hdr: ite.c 1.1 90/07/09$ | 36 | * from: Utah $Hdr: ite.c 1.1 90/07/09$ | |
37 | * | 37 | * | |
38 | * @(#)ite.c 7.6 (Berkeley) 5/16/91 | 38 | * @(#)ite.c 7.6 (Berkeley) 5/16/91 | |
39 | */ | 39 | */ | |
40 | 40 | |||
41 | /* | 41 | /* | |
42 | * ite - bitmaped terminal. | 42 | * ite - bitmaped terminal. | |
43 | * Supports VT200, a few terminal features will be unavailable until | 43 | * Supports VT200, a few terminal features will be unavailable until | |
44 | * the system actually probes the device (i.e. not after consinit()) | 44 | * the system actually probes the device (i.e. not after consinit()) | |
45 | */ | 45 | */ | |
46 | 46 | |||
47 | #include <sys/cdefs.h> | 47 | #include <sys/cdefs.h> | |
48 | __KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.70 2022/06/25 05:01:31 tsutsui Exp $"); | 48 | __KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.71 2024/01/07 07:58:33 isaki Exp $"); | |
49 | 49 | |||
50 | #include "ite.h" | 50 | #include "ite.h" | |
51 | #if NITE > 0 | 51 | #if NITE > 0 | |
52 | 52 | |||
53 | #include "bell.h" | 53 | #include "bell.h" | |
54 | #include "kbd.h" | 54 | #include "kbd.h" | |
55 | 55 | |||
56 | #include "opt_ite.h" | 56 | #include "opt_ite.h" | |
57 | 57 | |||
58 | #include <sys/param.h> | 58 | #include <sys/param.h> | |
59 | #include <sys/conf.h> | 59 | #include <sys/conf.h> | |
60 | #include <sys/proc.h> | 60 | #include <sys/proc.h> | |
61 | #include <sys/ioctl.h> | 61 | #include <sys/ioctl.h> | |
@@ -176,27 +176,27 @@ const struct cdevsw ite_cdevsw = { | @@ -176,27 +176,27 @@ const struct cdevsw ite_cdevsw = { | |||
176 | .d_stop = nostop, | 176 | .d_stop = nostop, | |
177 | .d_tty = itetty, | 177 | .d_tty = itetty, | |
178 | .d_poll = itepoll, | 178 | .d_poll = itepoll, | |
179 | .d_mmap = nommap, | 179 | .d_mmap = nommap, | |
180 | .d_kqfilter = ttykqfilter, | 180 | .d_kqfilter = ttykqfilter, | |
181 | .d_discard = nodiscard, | 181 | .d_discard = nodiscard, | |
182 | .d_flag = D_TTY | 182 | .d_flag = D_TTY | |
183 | }; | 183 | }; | |
184 | 184 | |||
185 | static int | 185 | static int | |
186 | itematch(device_t parent, cfdata_t cf, void *aux) | 186 | itematch(device_t parent, cfdata_t cf, void *aux) | |
187 | { | 187 | { | |
188 | struct grf_softc *gp; | 188 | struct grf_softc *gp; | |
189 | 189 | |||
190 | gp = aux; | 190 | gp = aux; | |
191 | if (cf->cf_loc[GRFCF_GRFADDR] != gp->g_cfaddr) | 191 | if (cf->cf_loc[GRFCF_GRFADDR] != gp->g_cfaddr) | |
192 | return 0; | 192 | return 0; | |
193 | 193 | |||
194 | return 1; | 194 | return 1; | |
195 | } | 195 | } | |
196 | 196 | |||
197 | /* | 197 | /* | |
198 | * iteinit() is the standard entry point for initialization of | 198 | * iteinit() is the standard entry point for initialization of | |
199 | * an ite device, it is also called from ite_cninit(). | 199 | * an ite device, it is also called from ite_cninit(). | |
200 | */ | 200 | */ | |
201 | static void | 201 | static void | |
202 | iteattach(device_t parent, device_t self, void *aux) | 202 | iteattach(device_t parent, device_t self, void *aux) | |
@@ -834,27 +834,27 @@ ite_filter(u_char c) | @@ -834,27 +834,27 @@ ite_filter(u_char c) | |||
834 | if ((mod & KBD_MOD_ALT) != 0) | 834 | if ((mod & KBD_MOD_ALT) != 0) | |
835 | key = kbdmap.alt_shift_keys[c]; | 835 | key = kbdmap.alt_shift_keys[c]; | |
836 | else | 836 | else | |
837 | key = kbdmap.shift_keys[c]; | 837 | key = kbdmap.shift_keys[c]; | |
838 | } else if ((mod & KBD_MOD_ALT) != 0) | 838 | } else if ((mod & KBD_MOD_ALT) != 0) | |
839 | key = kbdmap.alt_keys[c]; | 839 | key = kbdmap.alt_keys[c]; | |
840 | else { | 840 | else { | |
841 | key = kbdmap.keys[c]; | 841 | key = kbdmap.keys[c]; | |
842 | /* if CAPS and key is CAPable (no pun intended) */ | 842 | /* if CAPS and key is CAPable (no pun intended) */ | |
843 | if ((mod & KBD_MOD_CAPS) != 0 && | 843 | if ((mod & KBD_MOD_CAPS) != 0 && | |
844 | (key.mode & KBD_MODE_CAPS) != 0) | 844 | (key.mode & KBD_MODE_CAPS) != 0) | |
845 | key = kbdmap.shift_keys[c]; | 845 | key = kbdmap.shift_keys[c]; | |
846 | else if ((mod & KBD_MOD_OPT2) != 0 && | 846 | else if ((mod & KBD_MOD_OPT2) != 0 && | |
847 | (key.mode & KBD_MODE_KPAD) != 0) | 847 | (key.mode & KBD_MODE_KPAD) != 0) | |
848 | key = kbdmap.shift_keys[c]; | 848 | key = kbdmap.shift_keys[c]; | |
849 | } | 849 | } | |
850 | code = key.code; | 850 | code = key.code; | |
851 | 851 | |||
852 | /* handle dead keys */ | 852 | /* handle dead keys */ | |
853 | if ((key.mode & KBD_MODE_DEAD) != 0) { | 853 | if ((key.mode & KBD_MODE_DEAD) != 0) { | |
854 | splx(s); | 854 | splx(s); | |
855 | return; | 855 | return; | |
856 | } | 856 | } | |
857 | /* if not string, apply META and CTRL modifiers */ | 857 | /* if not string, apply META and CTRL modifiers */ | |
858 | if ((key.mode & KBD_MODE_STRING) == 0 && | 858 | if ((key.mode & KBD_MODE_STRING) == 0 && | |
859 | ((key.mode & KBD_MODE_KPAD) == 0 || | 859 | ((key.mode & KBD_MODE_KPAD) == 0 || | |
860 | (kbd_ite != NULL && kbd_ite->keypad_appmode == 0))) { | 860 | (kbd_ite != NULL && kbd_ite->keypad_appmode == 0))) { | |
@@ -1195,27 +1195,27 @@ ite_zargnum(struct ite_softc *ip) | @@ -1195,27 +1195,27 @@ ite_zargnum(struct ite_softc *ip) | |||
1195 | return n; /* don't "n ? n : 1" here, <CSI>0m != <CSI>1m ! */ | 1195 | return n; /* don't "n ? n : 1" here, <CSI>0m != <CSI>1m ! */ | |
1196 | } | 1196 | } | |
1197 | 1197 | |||
1198 | static void | 1198 | static void | |
1199 | ite_putstr(const u_char *s, int len, dev_t dev) | 1199 | ite_putstr(const u_char *s, int len, dev_t dev) | |
1200 | { | 1200 | { | |
1201 | struct ite_softc *ip; | 1201 | struct ite_softc *ip; | |
1202 | int i; | 1202 | int i; | |
1203 | 1203 | |||
1204 | ip = getitesp(dev); | 1204 | ip = getitesp(dev); | |
1205 | 1205 | |||
1206 | /* XXX avoid problems */ | 1206 | /* XXX avoid problems */ | |
1207 | if ((ip->flags & (ITE_ACTIVE|ITE_INGRF)) != ITE_ACTIVE) | 1207 | if ((ip->flags & (ITE_ACTIVE|ITE_INGRF)) != ITE_ACTIVE) | |
1208 | return; | 1208 | return; | |
1209 | 1209 | |||
1210 | SUBR_CURSOR(ip, START_CURSOROPT); | 1210 | SUBR_CURSOR(ip, START_CURSOROPT); | |
1211 | for (i = 0; i < len; i++) | 1211 | for (i = 0; i < len; i++) | |
1212 | if (s[i] != 0) | 1212 | if (s[i] != 0) | |
1213 | iteputchar(s[i], ip); | 1213 | iteputchar(s[i], ip); | |
1214 | SUBR_CURSOR(ip, END_CURSOROPT); | 1214 | SUBR_CURSOR(ip, END_CURSOROPT); | |
1215 | } | 1215 | } | |
1216 | 1216 | |||
1217 | static void | 1217 | static void | |
1218 | iteputchar(int c, struct ite_softc *ip) | 1218 | iteputchar(int c, struct ite_softc *ip) | |
1219 | { | 1219 | { | |
1220 | int n, x, y; | 1220 | int n, x, y; | |
1221 | char *cp; | 1221 | char *cp; | |
@@ -2212,115 +2212,115 @@ iteputchar(int c, struct ite_softc *ip) | @@ -2212,115 +2212,115 @@ iteputchar(int c, struct ite_softc *ip) | |||
2212 | if (ip->linefeed_newline) | 2212 | if (ip->linefeed_newline) | |
2213 | ite_crlf(ip); | 2213 | ite_crlf(ip); | |
2214 | else | 2214 | else | |
2215 | ite_lf(ip); | 2215 | ite_lf(ip); | |
2216 | break; | 2216 | break; | |
2217 | 2217 | |||
2218 | case CR: | 2218 | case CR: | |
2219 | ite_cr(ip); | 2219 | ite_cr(ip); | |
2220 | break; | 2220 | break; | |
2221 | 2221 | |||
2222 | case SO: | 2222 | case SO: | |
2223 | ip->GL = &ip->G1; | 2223 | ip->GL = &ip->G1; | |
2224 | break; | 2224 | break; | |
2225 | 2225 | |||
2226 | case SI: | 2226 | case SI: | |
2227 | ip->GL = &ip->G0; | 2227 | ip->GL = &ip->G0; | |
2228 | break; | 2228 | break; | |
2229 | 2229 | |||
2230 | case 0x10: /* DLE */ | 2230 | case 0x10: /* DLE */ | |
2231 | case 0x11: /* DC1/XON */ | 2231 | case 0x11: /* DC1/XON */ | |
2232 | case 0x12: /* DC2 */ | 2232 | case 0x12: /* DC2 */ | |
2233 | case 0x13: /* DC3/XOFF */ | 2233 | case 0x13: /* DC3/XOFF */ | |
2234 | case 0x14: /* DC4 */ | 2234 | case 0x14: /* DC4 */ | |
2235 | case 0x15: /* NAK */ | 2235 | case 0x15: /* NAK */ | |
2236 | case 0x16: /* SYN */ | 2236 | case 0x16: /* SYN */ | |
2237 | case 0x17: /* ETB */ | 2237 | case 0x17: /* ETB */ | |
2238 | break; | 2238 | break; | |
2239 | 2239 | |||
2240 | case CAN: | 2240 | case CAN: | |
2241 | ip->escape = 0; /* cancel any escape sequence in progress */ | 2241 | ip->escape = 0; /* cancel any escape sequence in progress */ | |
2242 | break; | 2242 | break; | |
2243 | 2243 | |||
2244 | case 0x19: /* EM */ | 2244 | case 0x19: /* EM */ | |
2245 | break; | 2245 | break; | |
2246 | 2246 | |||
2247 | case SUB: | 2247 | case SUB: | |
2248 | ip->escape = 0; /* dito, but see below */ | 2248 | ip->escape = 0; /* dito, but see below */ | |
2249 | /* should also display a reverse question mark!! */ | 2249 | /* should also display a reverse question mark!! */ | |
2250 | break; | 2250 | break; | |
2251 | 2251 | |||
2252 | case ESC: | 2252 | case ESC: | |
2253 | ip->escape = ESC; | 2253 | ip->escape = ESC; | |
2254 | break; | 2254 | break; | |
2255 | 2255 | |||
2256 | case 0x1c: /* FS */ | 2256 | case 0x1c: /* FS */ | |
2257 | case 0x1d: /* GS */ | 2257 | case 0x1d: /* GS */ | |
2258 | case 0x1e: /* RS */ | 2258 | case 0x1e: /* RS */ | |
2259 | case 0x1f: /* US */ | 2259 | case 0x1f: /* US */ | |
2260 | break; | 2260 | break; | |
2261 | 2261 | |||
2262 | /* now it gets weird.. 8bit control sequences.. */ | 2262 | /* now it gets weird.. 8bit control sequences.. */ | |
2263 | case IND: /* index: move cursor down, scroll */ | 2263 | case IND: /* index: move cursor down, scroll */ | |
2264 | ite_index(ip); | 2264 | ite_index(ip); | |
2265 | break; | 2265 | break; | |
2266 | 2266 | |||
2267 | case NEL: /* next line. next line, first pos. */ | 2267 | case NEL: /* next line. next line, first pos. */ | |
2268 | ite_crlf(ip); | 2268 | ite_crlf(ip); | |
2269 | break; | 2269 | break; | |
2270 | 2270 | |||
2271 | case HTS: /* set horizontal tab */ | 2271 | case HTS: /* set horizontal tab */ | |
2272 | if (ip->curx < ip->cols) | 2272 | if (ip->curx < ip->cols) | |
2273 | ip->tabs[ip->curx] = 1; | 2273 | ip->tabs[ip->curx] = 1; | |
2274 | break; | 2274 | break; | |
2275 | 2275 | |||
2276 | case RI: /* reverse index */ | 2276 | case RI: /* reverse index */ | |
2277 | ite_rlf(ip); | 2277 | ite_rlf(ip); | |
2278 | break; | 2278 | break; | |
2279 | 2279 | |||
2280 | case SS2: /* go into G2 for one character */ | 2280 | case SS2: /* go into G2 for one character */ | |
2281 | ip->save_GL = ip->GR; /* GL XXX EUC */ | 2281 | ip->save_GL = ip->GR; /* GL XXX EUC */ | |
2282 | ip->GR = &ip->G2; /* GL XXX */ | 2282 | ip->GR = &ip->G2; /* GL XXX */ | |
2283 | break; | 2283 | break; | |
2284 | 2284 | |||
2285 | case SS3: /* go into G3 for one character */ | 2285 | case SS3: /* go into G3 for one character */ | |
2286 | ip->save_GL = ip->GR; /* GL XXX EUC */ | 2286 | ip->save_GL = ip->GR; /* GL XXX EUC */ | |
2287 | ip->GR = &ip->G3; /* GL XXX */ | 2287 | ip->GR = &ip->G3; /* GL XXX */ | |
2288 | break; | 2288 | break; | |
2289 | 2289 | |||
2290 | case DCS: /* device control string introducer */ | 2290 | case DCS: /* device control string introducer */ | |
2291 | ip->escape = DCS; | 2291 | ip->escape = DCS; | |
2292 | ip->ap = ip->argbuf; | 2292 | ip->ap = ip->argbuf; | |
2293 | break; | 2293 | break; | |
2294 | 2294 | |||
2295 | case CSI: /* control sequence introducer */ | 2295 | case CSI: /* control sequence introducer */ | |
2296 | ip->escape = CSI; | 2296 | ip->escape = CSI; | |
2297 | ip->ap = ip->argbuf; | 2297 | ip->ap = ip->argbuf; | |
2298 | break; | 2298 | break; | |
2299 | 2299 | |||
2300 | case ST: /* string terminator */ | 2300 | case ST: /* string terminator */ | |
2301 | /* ignore, if not used as terminator */ | 2301 | /* ignore, if not used as terminator */ | |
2302 | break; | 2302 | break; | |
2303 | 2303 | |||
2304 | case OSC: /* introduces OS command. */ | 2304 | case OSC: /* introduces OS command. */ | |
2305 | /* Ignore everything upto ST */ | 2305 | /* Ignore everything upto ST */ | |
2306 | ip->escape = OSC; | 2306 | ip->escape = OSC; | |
2307 | break; | 2307 | break; | |
2308 | 2308 | |||
2309 | case PM: /* privacy message */ | 2309 | case PM: /* privacy message */ | |
2310 | /* ignore everything upto ST */ | 2310 | /* ignore everything upto ST */ | |
2311 | ip->escape = PM; | 2311 | ip->escape = PM; | |
2312 | break; | 2312 | break; | |
2313 | 2313 | |||
2314 | case APC: /* application program command */ | 2314 | case APC: /* application program command */ | |
2315 | /* ignore everything upto ST */ | 2315 | /* ignore everything upto ST */ | |
2316 | ip->escape = APC; | 2316 | ip->escape = APC; | |
2317 | break; | 2317 | break; | |
2318 | 2318 | |||
2319 | case DEL: | 2319 | case DEL: | |
2320 | break; | 2320 | break; | |
2321 | 2321 | |||
2322 | default: | 2322 | default: | |
2323 | if (ip->save_char == 0 && | 2323 | if (ip->save_char == 0 && | |
2324 | (*((c & 0x80) ? ip->GR : ip->GL) & CSET_MULTI) != 0) { | 2324 | (*((c & 0x80) ? ip->GR : ip->GL) & CSET_MULTI) != 0) { | |
2325 | ip->save_char = c; | 2325 | ip->save_char = c; | |
2326 | break; | 2326 | break; | |
@@ -2537,27 +2537,27 @@ itecngetc(dev_t dev) | @@ -2537,27 +2537,27 @@ itecngetc(dev_t dev) | |||
2537 | } while (c == -1); | 2537 | } while (c == -1); | |
2538 | return (c); | 2538 | return (c); | |
2539 | } | 2539 | } | |
2540 | 2540 | |||
2541 | void | 2541 | void | |
2542 | itecnputc(dev_t dev, int c) | 2542 | itecnputc(dev_t dev, int c) | |
2543 | { | 2543 | { | |
2544 | static int paniced = 0; | 2544 | static int paniced = 0; | |
2545 | struct ite_softc *ip = getitesp(dev); | 2545 | struct ite_softc *ip = getitesp(dev); | |
2546 | char ch = c; | 2546 | char ch = c; | |
2547 | #ifdef ITE_KERNEL_ATTR | 2547 | #ifdef ITE_KERNEL_ATTR | |
2548 | short save_attribute; | 2548 | short save_attribute; | |
2549 | #endif | 2549 | #endif | |
2550 | 2550 | |||
2551 | if (panicstr && !paniced && | 2551 | if (panicstr && !paniced && | |
2552 | (ip->flags & (ITE_ACTIVE|ITE_INGRF)) != ITE_ACTIVE) { | 2552 | (ip->flags & (ITE_ACTIVE|ITE_INGRF)) != ITE_ACTIVE) { | |
2553 | (void) iteon(dev, 3); | 2553 | (void) iteon(dev, 3); | |
2554 | paniced = 1; | 2554 | paniced = 1; | |
2555 | } | 2555 | } | |
2556 | #ifdef ITE_KERNEL_ATTR | 2556 | #ifdef ITE_KERNEL_ATTR | |
2557 | save_attribute = ip->attribute; | 2557 | save_attribute = ip->attribute; | |
2558 | ip->attribute = ITE_KERNEL_ATTR; | 2558 | ip->attribute = ITE_KERNEL_ATTR; | |
2559 | #endif | 2559 | #endif | |
2560 | ite_putstr(&ch, 1, dev); | 2560 | ite_putstr(&ch, 1, dev); | |
2561 | #ifdef ITE_KERNEL_ATTR | 2561 | #ifdef ITE_KERNEL_ATTR | |
2562 | ip->attribute = save_attribute; | 2562 | ip->attribute = save_attribute; | |
2563 | #endif | 2563 | #endif |
--- src/sys/arch/x68k/dev/ite_tv.c 2022/06/25 03:57:17 1.19
+++ src/sys/arch/x68k/dev/ite_tv.c 2024/01/07 07:58:33 1.20
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ite_tv.c,v 1.19 2022/06/25 03:57:17 tsutsui Exp $ */ | 1 | /* $NetBSD: ite_tv.c,v 1.20 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1997 Masaru Oki. | 4 | * Copyright (c) 1997 Masaru Oki. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: ite_tv.c,v 1.19 2022/06/25 03:57:17 tsutsui Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: ite_tv.c,v 1.20 2024/01/07 07:58:33 isaki Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/device.h> | 37 | #include <sys/device.h> | |
38 | #include <sys/proc.h> | 38 | #include <sys/proc.h> | |
39 | #include <sys/systm.h> | 39 | #include <sys/systm.h> | |
40 | 40 | |||
41 | #include <machine/bus.h> | 41 | #include <machine/bus.h> | |
42 | #include <machine/grfioctl.h> | 42 | #include <machine/grfioctl.h> | |
43 | 43 | |||
44 | #include <arch/x68k/x68k/iodevice.h> | 44 | #include <arch/x68k/x68k/iodevice.h> | |
45 | #include <arch/x68k/dev/itevar.h> | 45 | #include <arch/x68k/dev/itevar.h> | |
46 | #include <arch/x68k/dev/grfvar.h> | 46 | #include <arch/x68k/dev/grfvar.h> | |
47 | #include <arch/x68k/dev/mfp.h> | 47 | #include <arch/x68k/dev/mfp.h> | |
@@ -132,27 +132,27 @@ txrascpy(uint8_t src, uint8_t dst, int16 | @@ -132,27 +132,27 @@ txrascpy(uint8_t src, uint8_t dst, int16 | |||
132 | /* stop raster copy */ | 132 | /* stop raster copy */ | |
133 | CRTC.crtctrl = 0x0000; | 133 | CRTC.crtctrl = 0x0000; | |
134 | 134 | |||
135 | CRTC.r21 = saved_r21; | 135 | CRTC.r21 = saved_r21; | |
136 | } | 136 | } | |
137 | 137 | |||
138 | /* | 138 | /* | |
139 | * Change glyphs from SRAM switch. | 139 | * Change glyphs from SRAM switch. | |
140 | */ | 140 | */ | |
141 | void | 141 | void | |
142 | ite_set_glyph(void) | 142 | ite_set_glyph(void) | |
143 | { | 143 | { | |
144 | uint8_t glyph = IODEVbase->io_sram[0x59]; | 144 | uint8_t glyph = IODEVbase->io_sram[0x59]; | |
145 | 145 | |||
146 | if ((glyph & 4) != 0) | 146 | if ((glyph & 4) != 0) | |
147 | SETGLYPH(0x82, '|'); | 147 | SETGLYPH(0x82, '|'); | |
148 | if ((glyph & 2) != 0) | 148 | if ((glyph & 2) != 0) | |
149 | SETGLYPH(0x81, '~'); | 149 | SETGLYPH(0x81, '~'); | |
150 | if ((glyph & 1) != 0) | 150 | if ((glyph & 1) != 0) | |
151 | SETGLYPH(0x80, '\\'); | 151 | SETGLYPH(0x80, '\\'); | |
152 | } | 152 | } | |
153 | 153 | |||
154 | /* | 154 | /* | |
155 | * Initialize | 155 | * Initialize | |
156 | */ | 156 | */ | |
157 | void | 157 | void | |
158 | tv_init(struct ite_softc *ip) | 158 | tv_init(struct ite_softc *ip) |
--- src/sys/arch/x68k/dev/vsvar.h 2021/02/06 12:50:04 1.19
+++ src/sys/arch/x68k/dev/vsvar.h 2024/01/07 07:58:33 1.20
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: vsvar.h,v 1.19 2021/02/06 12:50:04 isaki Exp $ */ | 1 | /* $NetBSD: vsvar.h,v 1.20 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 Tetsuya Isaki. All rights reserved. | 4 | * Copyright (c) 2001 Tetsuya Isaki. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
@@ -49,27 +49,27 @@ | @@ -49,27 +49,27 @@ | |||
49 | 49 | |||
50 | #define VS_SRATE_1024 (0x00) | 50 | #define VS_SRATE_1024 (0x00) | |
51 | #define VS_SRATE_768 (0x04) | 51 | #define VS_SRATE_768 (0x04) | |
52 | #define VS_SRATE_512 (0x08) | 52 | #define VS_SRATE_512 (0x08) | |
53 | 53 | |||
54 | #define VS_PANOUT_LR (0x00) | 54 | #define VS_PANOUT_LR (0x00) | |
55 | #define VS_PANOUT_R (0x01) | 55 | #define VS_PANOUT_R (0x01) | |
56 | #define VS_PANOUT_L (0x02) | 56 | #define VS_PANOUT_L (0x02) | |
57 | #define VS_PANOUT_OFF (0x03) | 57 | #define VS_PANOUT_OFF (0x03) | |
58 | 58 | |||
59 | #define VS_MAX_BUFSIZE (65536*4) /* XXX: enough? */ | 59 | #define VS_MAX_BUFSIZE (65536*4) /* XXX: enough? */ | |
60 | 60 | |||
61 | /* XXX: msm6258vreg.h */ | 61 | /* XXX: msm6258vreg.h */ | |
62 | #define MSM6258_CMD 0 /* W */ | 62 | #define MSM6258_CMD 0 /* W */ | |
63 | #define MSM6258_CMD_STOP (0x01) | 63 | #define MSM6258_CMD_STOP (0x01) | |
64 | #define MSM6258_CMD_PLAY_START (0x02) | 64 | #define MSM6258_CMD_PLAY_START (0x02) | |
65 | #define MSM6258_CMD_REC_START (0x04) | 65 | #define MSM6258_CMD_REC_START (0x04) | |
66 | #define MSM6258_STAT 0 /* R */ | 66 | #define MSM6258_STAT 0 /* R */ | |
67 | #define MSM6258_DATA 1 /* R/W */ | 67 | #define MSM6258_DATA 1 /* R/W */ | |
68 | 68 | |||
69 | struct vs_dma { | 69 | struct vs_dma { | |
70 | bus_dma_tag_t vd_dmat; | 70 | bus_dma_tag_t vd_dmat; | |
71 | bus_dmamap_t vd_map; | 71 | bus_dmamap_t vd_map; | |
72 | void * vd_addr; | 72 | void * vd_addr; | |
73 | bus_dma_segment_t vd_segs[1]; | 73 | bus_dma_segment_t vd_segs[1]; | |
74 | int vd_nsegs; | 74 | int vd_nsegs; | |
75 | size_t vd_size; | 75 | size_t vd_size; |
--- src/sys/arch/x68k/dev/itevar.h 2022/06/25 03:18:38 1.16
+++ src/sys/arch/x68k/dev/itevar.h 2024/01/07 07:58:33 1.17
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: itevar.h,v 1.16 2022/06/25 03:18:38 tsutsui Exp $ */ | 1 | /* $NetBSD: itevar.h,v 1.17 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988 University of Utah. | 4 | * Copyright (c) 1988 University of Utah. | |
5 | * Copyright (c) 1990 The Regents of the University of California. | 5 | * Copyright (c) 1990 The Regents of the University of California. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department. | 10 | * Science Department. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -136,48 +136,48 @@ enum emul_level { | @@ -136,48 +136,48 @@ enum emul_level { | |||
136 | #endif | 136 | #endif | |
137 | 137 | |||
138 | 138 | |||
139 | /* | 139 | /* | |
140 | * X and Y location of character 'c' in the framebuffer, in pixels. | 140 | * X and Y location of character 'c' in the framebuffer, in pixels. | |
141 | */ | 141 | */ | |
142 | #define charX(ip,c) \ | 142 | #define charX(ip,c) \ | |
143 | (((c) % (ip)->cpl) * (ip)->ftwidth + (ip)->fontx) | 143 | (((c) % (ip)->cpl) * (ip)->ftwidth + (ip)->fontx) | |
144 | 144 | |||
145 | #define charY(ip,c) \ | 145 | #define charY(ip,c) \ | |
146 | (((c) / (ip)->cpl) * (ip)->ftheight + (ip)->fonty) | 146 | (((c) / (ip)->cpl) * (ip)->ftheight + (ip)->fonty) | |
147 | 147 | |||
148 | /* Character attributes */ | 148 | /* Character attributes */ | |
149 | #define ATTR_NOR 0x0 /* normal */ | 149 | #define ATTR_NOR 0x0 /* normal */ | |
150 | #define ATTR_INV 0x1 /* inverse */ | 150 | #define ATTR_INV 0x1 /* inverse */ | |
151 | #define ATTR_UL 0x2 /* underline */ | 151 | #define ATTR_UL 0x2 /* underline */ | |
152 | #define ATTR_BOLD 0x4 /* bold */ | 152 | #define ATTR_BOLD 0x4 /* bold */ | |
153 | #define ATTR_BLINK 0x8 /* blink */ | 153 | #define ATTR_BLINK 0x8 /* blink */ | |
154 | #define ATTR_ALL (ATTR_INV | ATTR_UL|ATTR_BOLD|ATTR_BLINK) | 154 | #define ATTR_ALL (ATTR_INV | ATTR_UL|ATTR_BOLD|ATTR_BLINK) | |
155 | 155 | |||
156 | /* Keyboard attributes */ | 156 | /* Keyboard attributes */ | |
157 | #define ATTR_KPAD 0x80 /* keypad transmit */ | 157 | #define ATTR_KPAD 0x80 /* keypad transmit */ | |
158 | 158 | |||
159 | /* Replacement Rules */ | 159 | /* Replacement Rules */ | |
160 | #define RR_CLEAR 0x0 | 160 | #define RR_CLEAR 0x0 | |
161 | #define RR_COPY 0x3 | 161 | #define RR_COPY 0x3 | |
162 | #define RR_XOR 0x6 | 162 | #define RR_XOR 0x6 | |
163 | #define RR_COPYINVERTED 0xc | 163 | #define RR_COPYINVERTED 0xc | |
164 | 164 | |||
165 | #define SCROLL_UP 0x01 | 165 | #define SCROLL_UP 0x01 | |
166 | #define SCROLL_DOWN 0x02 | 166 | #define SCROLL_DOWN 0x02 | |
167 | #define SCROLL_LEFT 0x03 | 167 | #define SCROLL_LEFT 0x03 | |
168 | #define SCROLL_RIGHT 0x04 | 168 | #define SCROLL_RIGHT 0x04 | |
169 | #define DRAW_CURSOR 0x05 | 169 | #define DRAW_CURSOR 0x05 | |
170 | #define ERASE_CURSOR 0x06 | 170 | #define ERASE_CURSOR 0x06 | |
171 | #define MOVE_CURSOR 0x07 | 171 | #define MOVE_CURSOR 0x07 | |
172 | #define START_CURSOROPT 0x08 /* at start of output. May disable cursor */ | 172 | #define START_CURSOROPT 0x08 /* at start of output. May disable cursor */ | |
173 | #define END_CURSOROPT 0x09 /* at end, make sure cursor state is ok */ | 173 | #define END_CURSOROPT 0x09 /* at end, make sure cursor state is ok */ | |
174 | 174 | |||
175 | /* special key codes */ | 175 | /* special key codes */ | |
176 | #define KBD_LEFT_SHIFT 0x70 | 176 | #define KBD_LEFT_SHIFT 0x70 | |
177 | #define KBD_RIGHT_SHIFT 0x70 | 177 | #define KBD_RIGHT_SHIFT 0x70 | |
178 | #define KBD_CAPS_LOCK 0x5d | 178 | #define KBD_CAPS_LOCK 0x5d | |
179 | #define KBD_CTRL 0x71 | 179 | #define KBD_CTRL 0x71 | |
180 | #define KBD_LEFT_ALT 0x55 | 180 | #define KBD_LEFT_ALT 0x55 | |
181 | #define KBD_RIGHT_ALT 0x58 | 181 | #define KBD_RIGHT_ALT 0x58 | |
182 | #define KBD_LEFT_META 0x56 | 182 | #define KBD_LEFT_META 0x56 | |
183 | #define KBD_RIGHT_META 0x57 | 183 | #define KBD_RIGHT_META 0x57 |
--- src/sys/arch/x68k/dev/kbdmap.c 2022/05/26 14:28:56 1.8
+++ src/sys/arch/x68k/dev/kbdmap.c 2024/01/07 07:58:33 1.9
@@ -1,20 +1,20 @@ | @@ -1,20 +1,20 @@ | |||
1 | /* $NetBSD: kbdmap.c,v 1.8 2022/05/26 14:28:56 tsutsui Exp $ */ | 1 | /* $NetBSD: kbdmap.c,v 1.9 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* from: arch/amiga/dev/kbdmap.c */ | 3 | /* from: arch/amiga/dev/kbdmap.c */ | |
4 | /* modified for X680x0 by Masaru Oki and Makoto MINOURA */ | 4 | /* modified for X680x0 by Masaru Oki and Makoto MINOURA */ | |
5 | 5 | |||
6 | #include <sys/cdefs.h> | 6 | #include <sys/cdefs.h> | |
7 | __KERNEL_RCSID(0, "$NetBSD: kbdmap.c,v 1.8 2022/05/26 14:28:56 tsutsui Exp $"); | 7 | __KERNEL_RCSID(0, "$NetBSD: kbdmap.c,v 1.9 2024/01/07 07:58:33 isaki Exp $"); | |
8 | 8 | |||
9 | #include "kbdmap.h" | 9 | #include "kbdmap.h" | |
10 | 10 | |||
11 | /* define a default keymap. This can be changed by keyboard ioctl's */ | 11 | /* define a default keymap. This can be changed by keyboard ioctl's */ | |
12 | 12 | |||
13 | /* mode shortcuts: */ | 13 | /* mode shortcuts: */ | |
14 | #define S KBD_MODE_STRING | 14 | #define S KBD_MODE_STRING | |
15 | #define DG (KBD_MODE_DEAD | KBD_MODE_GRAVE) | 15 | #define DG (KBD_MODE_DEAD | KBD_MODE_GRAVE) | |
16 | #define DA (KBD_MODE_DEAD | KBD_MODE_ACUTE) | 16 | #define DA (KBD_MODE_DEAD | KBD_MODE_ACUTE) | |
17 | #define DC (KBD_MODE_DEAD | KBD_MODE_CIRC) | 17 | #define DC (KBD_MODE_DEAD | KBD_MODE_CIRC) | |
18 | #define DT (KBD_MODE_DEAD | KBD_MODE_TILDE) | 18 | #define DT (KBD_MODE_DEAD | KBD_MODE_TILDE) | |
19 | #define DD (KBD_MODE_DEAD | KBD_MODE_DIER) | 19 | #define DD (KBD_MODE_DEAD | KBD_MODE_DIER) | |
20 | #define C KBD_MODE_CAPS | 20 | #define C KBD_MODE_CAPS | |
@@ -170,27 +170,27 @@ const struct kbdmap ascii_kbdmap = { | @@ -170,27 +170,27 @@ const struct kbdmap ascii_kbdmap = { | |||
170 | {0, '\r'}, /* return */ | 170 | {0, '\r'}, /* return */ | |
171 | {C, 'A'}, | 171 | {C, 'A'}, | |
172 | {C, 'S'}, | 172 | {C, 'S'}, | |
173 | {C, 'D'}, /* 0x20 */ | 173 | {C, 'D'}, /* 0x20 */ | |
174 | {C, 'F'}, | 174 | {C, 'F'}, | |
175 | {C, 'G'}, | 175 | {C, 'G'}, | |
176 | {C, 'H'}, | 176 | {C, 'H'}, | |
177 | {C, 'J'}, | 177 | {C, 'J'}, | |
178 | {C, 'K'}, | 178 | {C, 'K'}, | |
179 | {C, 'L'}, | 179 | {C, 'L'}, | |
180 | {0, '+'}, | 180 | {0, '+'}, | |
181 | {0, '*'}, /* 0x28 */ | 181 | {0, '*'}, /* 0x28 */ | |
182 | {0, '}'}, | 182 | {0, '}'}, | |
183 | {C, 'Z'}, | 183 | {C, 'Z'}, | |
184 | {C, 'X'}, | 184 | {C, 'X'}, | |
185 | {C, 'C'}, | 185 | {C, 'C'}, | |
186 | {C, 'V'}, | 186 | {C, 'V'}, | |
187 | {C, 'B'}, | 187 | {C, 'B'}, | |
188 | {C, 'N'}, | 188 | {C, 'N'}, | |
189 | {C, 'M'}, /* 0x30 */ | 189 | {C, 'M'}, /* 0x30 */ | |
190 | {0, '<'}, /* 0x38 */ | 190 | {0, '<'}, /* 0x38 */ | |
191 | {0, '>'}, | 191 | {0, '>'}, | |
192 | {0, '?'}, | 192 | {0, '?'}, | |
193 | {0, '_'}, | 193 | {0, '_'}, | |
194 | {0, ' '}, | 194 | {0, ' '}, | |
195 | {S, 0x4a}, /* HOME */ | 195 | {S, 0x4a}, /* HOME */ | |
196 | {0, '\b'}, /* really DEL, BS & DEL swapped */ | 196 | {0, '\b'}, /* really DEL, BS & DEL swapped */ |
--- src/sys/arch/x68k/dev/kbdmap.c.ascii 2022/05/26 14:28:56 1.5
+++ src/sys/arch/x68k/dev/kbdmap.c.ascii 2024/01/07 07:58:33 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kbdmap.c.ascii,v 1.5 2022/05/26 14:28:56 tsutsui Exp $ */ | 1 | /* $NetBSD: kbdmap.c.ascii,v 1.6 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | /* from: arch/amiga/dev/kbdmap.c */ | 2 | /* from: arch/amiga/dev/kbdmap.c */ | |
3 | /* modified for X680x0 by Masaru Oki */ | 3 | /* modified for X680x0 by Masaru Oki */ | |
4 | 4 | |||
5 | #include "kbdmap.h" | 5 | #include "kbdmap.h" | |
6 | 6 | |||
7 | /* define a default keymap. This can be changed by keyboard ioctl's | 7 | /* define a default keymap. This can be changed by keyboard ioctl's | |
8 | (later at least..) */ | 8 | (later at least..) */ | |
9 | 9 | |||
10 | /* mode shortcuts: */ | 10 | /* mode shortcuts: */ | |
11 | #define S KBD_MODE_STRING | 11 | #define S KBD_MODE_STRING | |
12 | #define DG (KBD_MODE_DEAD | KBD_MODE_GRAVE) | 12 | #define DG (KBD_MODE_DEAD | KBD_MODE_GRAVE) | |
13 | #define DA (KBD_MODE_DEAD | KBD_MODE_ACUTE) | 13 | #define DA (KBD_MODE_DEAD | KBD_MODE_ACUTE) | |
14 | #define DC (KBD_MODE_DEAD | KBD_MODE_CIRC) | 14 | #define DC (KBD_MODE_DEAD | KBD_MODE_CIRC) | |
@@ -166,27 +166,27 @@ const struct kbdmap ascii_kbdmap = { | @@ -166,27 +166,27 @@ const struct kbdmap ascii_kbdmap = { | |||
166 | 0, '\r', /* return */ | 166 | 0, '\r', /* return */ | |
167 | C, 'A', | 167 | C, 'A', | |
168 | C, 'S', | 168 | C, 'S', | |
169 | C, 'D', /* 0x20 */ | 169 | C, 'D', /* 0x20 */ | |
170 | C, 'F', | 170 | C, 'F', | |
171 | C, 'G', | 171 | C, 'G', | |
172 | C, 'H', | 172 | C, 'H', | |
173 | C, 'J', | 173 | C, 'J', | |
174 | C, 'K', | 174 | C, 'K', | |
175 | C, 'L', | 175 | C, 'L', | |
176 | 0, ':', | 176 | 0, ':', | |
177 | 0, '\"', /* 0x28 */ | 177 | 0, '\"', /* 0x28 */ | |
178 | 0, '~', | 178 | 0, '~', | |
179 | C, 'Z', | 179 | C, 'Z', | |
180 | C, 'X', | 180 | C, 'X', | |
181 | C, 'C', | 181 | C, 'C', | |
182 | C, 'V', | 182 | C, 'V', | |
183 | C, 'B', | 183 | C, 'B', | |
184 | C, 'N', | 184 | C, 'N', | |
185 | C, 'M', /* 0x30 */ | 185 | C, 'M', /* 0x30 */ | |
186 | 0, '<', /* 0x38 */ | 186 | 0, '<', /* 0x38 */ | |
187 | 0, '>', | 187 | 0, '>', | |
188 | 0, '?', | 188 | 0, '?', | |
189 | 0, '_', | 189 | 0, '_', | |
190 | 0, ' ', | 190 | 0, ' ', | |
191 | 0, 0, /* HOME */ | 191 | 0, 0, /* HOME */ | |
192 | 0, '\b', /* really DEL, BS & DEL swapped */ | 192 | 0, '\b', /* really DEL, BS & DEL swapped */ | |
@@ -290,15 +290,13 @@ const struct kbdmap ascii_kbdmap = { | @@ -290,15 +290,13 @@ const struct kbdmap ascii_kbdmap = { | |||
290 | 5, ESC, '[', '1', '4', '~', /* 0x75: shift F5 */ | 290 | 5, ESC, '[', '1', '4', '~', /* 0x75: shift F5 */ | |
291 | 5, ESC, '[', '1', '5', '~', /* 0x7B: shift F6 */ | 291 | 5, ESC, '[', '1', '5', '~', /* 0x7B: shift F6 */ | |
292 | 5, ESC, '[', '1', '6', '~', /* 0x81: shift F7 */ | 292 | 5, ESC, '[', '1', '6', '~', /* 0x81: shift F7 */ | |
293 | 5, ESC, '[', '1', '7', '~', /* 0x87: shift F8 */ | 293 | 5, ESC, '[', '1', '7', '~', /* 0x87: shift F8 */ | |
294 | 5, ESC, '[', '1', '8', '~', /* 0x8D: shift F9 */ | 294 | 5, ESC, '[', '1', '8', '~', /* 0x8D: shift F9 */ | |
295 | 5, ESC, '[', '1', '9', '~', /* 0x93: shift F10 */ | 295 | 5, ESC, '[', '1', '9', '~', /* 0x93: shift F10 */ | |
296 | 3, ESC, '[', 'Z', /* 0x99: shift TAB */ | 296 | 3, ESC, '[', 'Z', /* 0x99: shift TAB */ | |
297 | 2, ESC, '[', /* 0x9d: alt ESC == CSI */ | 297 | 2, ESC, '[', /* 0x9d: alt ESC == CSI */ | |
298 | }, | 298 | }, | |
299 | }; | 299 | }; | |
300 | 300 | |||
301 | unsigned char acctable[KBD_NUM_ACC][64] = { | 301 | unsigned char acctable[KBD_NUM_ACC][64] = { | |
302 | }; | 302 | }; | |
303 | ||||
304 |
--- src/sys/arch/x68k/dev/mha.c 2023/12/17 22:07:34 1.60
+++ src/sys/arch/x68k/dev/mha.c 2024/01/07 07:58:33 1.61
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mha.c,v 1.60 2023/12/17 22:07:34 andvar Exp $ */ | 1 | /* $NetBSD: mha.c,v 1.61 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996-1999 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996-1999 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Charles M. Hannum, Masaru Oki, Takumi Nakamura, Masanobu Saitoh and | 8 | * by Charles M. Hannum, Masaru Oki, Takumi Nakamura, Masanobu Saitoh and | |
9 | * Minoura Makoto. | 9 | * Minoura Makoto. | |
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 | |
@@ -49,33 +49,33 @@ | @@ -49,33 +49,33 @@ | |||
49 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 49 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
50 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 50 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
51 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | 51 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | |
52 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 52 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
53 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 53 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
54 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 54 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
56 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | 56 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
57 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 57 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
58 | * POSSIBILITY OF SUCH DAMAGE. | 58 | * POSSIBILITY OF SUCH DAMAGE. | |
59 | */ | 59 | */ | |
60 | 60 | |||
61 | #include <sys/cdefs.h> | 61 | #include <sys/cdefs.h> | |
62 | __KERNEL_RCSID(0, "$NetBSD: mha.c,v 1.60 2023/12/17 22:07:34 andvar Exp $"); | 62 | __KERNEL_RCSID(0, "$NetBSD: mha.c,v 1.61 2024/01/07 07:58:33 isaki Exp $"); | |
63 | 63 | |||
64 | #include "opt_ddb.h" | 64 | #include "opt_ddb.h" | |
65 | 65 | |||
66 | /* Synchronous data transfers? */ | 66 | /* Synchronous data transfers? */ | |
67 | #define SPC_USE_SYNCHRONOUS 0 | 67 | #define SPC_USE_SYNCHRONOUS 0 | |
68 | #define SPC_SYNC_REQ_ACK_OFS 8 | 68 | #define SPC_SYNC_REQ_ACK_OFS 8 | |
69 | 69 | |||
70 | /* Default DMA mode? */ | 70 | /* Default DMA mode? */ | |
71 | #define MHA_DMA_LIMIT_XFER 1 | 71 | #define MHA_DMA_LIMIT_XFER 1 | |
72 | #define MHA_DMA_BURST_XFER 1 | 72 | #define MHA_DMA_BURST_XFER 1 | |
73 | #define MHA_DMA_SHORT_BUS_CYCLE 1 | 73 | #define MHA_DMA_SHORT_BUS_CYCLE 1 | |
74 | 74 | |||
75 | #define MHA_DMA_DATAIN (0 | (MHA_DMA_LIMIT_XFER << 1) \ | 75 | #define MHA_DMA_DATAIN (0 | (MHA_DMA_LIMIT_XFER << 1) \ | |
76 | | (MHA_DMA_BURST_XFER << 2) \ | 76 | | (MHA_DMA_BURST_XFER << 2) \ | |
77 | | (MHA_DMA_SHORT_BUS_CYCLE << 3)) | 77 | | (MHA_DMA_SHORT_BUS_CYCLE << 3)) | |
78 | #define MHA_DMA_DATAOUT (1 | (MHA_DMA_LIMIT_XFER << 1) \ | 78 | #define MHA_DMA_DATAOUT (1 | (MHA_DMA_LIMIT_XFER << 1) \ | |
79 | | (MHA_DMA_BURST_XFER << 2) \ | 79 | | (MHA_DMA_BURST_XFER << 2) \ | |
80 | | (MHA_DMA_SHORT_BUS_CYCLE << 3)) | 80 | | (MHA_DMA_SHORT_BUS_CYCLE << 3)) | |
81 | 81 | |||
@@ -237,27 +237,27 @@ int mhamatch(device_t, cfdata_t, void *) | @@ -237,27 +237,27 @@ int mhamatch(device_t, cfdata_t, void *) | |||
237 | void mhaattach(device_t, device_t, void *); | 237 | void mhaattach(device_t, device_t, void *); | |
238 | void mhaselect(struct mha_softc *, u_char, u_char, u_char *, u_char); | 238 | void mhaselect(struct mha_softc *, u_char, u_char, u_char *, u_char); | |
239 | void mha_scsi_reset(struct mha_softc *); | 239 | void mha_scsi_reset(struct mha_softc *); | |
240 | void mha_reset(struct mha_softc *); | 240 | void mha_reset(struct mha_softc *); | |
241 | void mha_free_acb(struct mha_softc *, struct acb *, int); | 241 | void mha_free_acb(struct mha_softc *, struct acb *, int); | |
242 | void mha_sense(struct mha_softc *, struct acb *); | 242 | void mha_sense(struct mha_softc *, struct acb *); | |
243 | void mha_msgin(struct mha_softc *); | 243 | void mha_msgin(struct mha_softc *); | |
244 | void mha_msgout(struct mha_softc *); | 244 | void mha_msgout(struct mha_softc *); | |
245 | int mha_dataout_pio(struct mha_softc *, u_char *, int); | 245 | int mha_dataout_pio(struct mha_softc *, u_char *, int); | |
246 | int mha_datain_pio(struct mha_softc *, u_char *, int); | 246 | int mha_datain_pio(struct mha_softc *, u_char *, int); | |
247 | int mha_dataout(struct mha_softc *, u_char *, int); | 247 | int mha_dataout(struct mha_softc *, u_char *, int); | |
248 | int mha_datain(struct mha_softc *, u_char *, int); | 248 | int mha_datain(struct mha_softc *, u_char *, int); | |
249 | void mha_abort(struct mha_softc *, struct acb *); | 249 | void mha_abort(struct mha_softc *, struct acb *); | |
250 | void mha_init(struct mha_softc *); | 250 | void mha_init(struct mha_softc *); | |
251 | void mha_scsi_request(struct scsipi_channel *, scsipi_adapter_req_t, void *); | 251 | void mha_scsi_request(struct scsipi_channel *, scsipi_adapter_req_t, void *); | |
252 | void mha_poll(struct mha_softc *, struct acb *); | 252 | void mha_poll(struct mha_softc *, struct acb *); | |
253 | void mha_sched(struct mha_softc *); | 253 | void mha_sched(struct mha_softc *); | |
254 | void mha_done(struct mha_softc *, struct acb *); | 254 | void mha_done(struct mha_softc *, struct acb *); | |
255 | int mhaintr(void *); | 255 | int mhaintr(void *); | |
256 | void mha_timeout(void *); | 256 | void mha_timeout(void *); | |
257 | void mha_minphys(struct buf *); | 257 | void mha_minphys(struct buf *); | |
258 | void mha_dequeue(struct mha_softc *, struct acb *); | 258 | void mha_dequeue(struct mha_softc *, struct acb *); | |
259 | inline void mha_setsync(struct mha_softc *, struct spc_tinfo *); | 259 | inline void mha_setsync(struct mha_softc *, struct spc_tinfo *); | |
260 | #if SPC_DEBUG | 260 | #if SPC_DEBUG | |
261 | void mha_print_acb(struct acb *); | 261 | void mha_print_acb(struct acb *); | |
262 | void mha_show_scsi_cmd(struct acb *); | 262 | void mha_show_scsi_cmd(struct acb *); | |
263 | void mha_print_active_acb(void); | 263 | void mha_print_active_acb(void); | |
@@ -1205,27 +1205,27 @@ gotit: | @@ -1205,27 +1205,27 @@ gotit: | |||
1205 | if (!MSG_ISIDENTIFY(sc->sc_imess[0])) { | 1205 | if (!MSG_ISIDENTIFY(sc->sc_imess[0])) { | |
1206 | SPC_MISC(("unknown ")); | 1206 | SPC_MISC(("unknown ")); | |
1207 | printf("%s: unimplemented message: %d\n", device_xname(sc->sc_dev), sc->sc_imess[0]); | 1207 | printf("%s: unimplemented message: %d\n", device_xname(sc->sc_dev), sc->sc_imess[0]); | |
1208 | CMR = CMD_SET_ATN; /* XXX? */ | 1208 | CMR = CMD_SET_ATN; /* XXX? */ | |
1209 | } | 1209 | } | |
1210 | break; | 1210 | break; | |
1211 | } | 1211 | } | |
1212 | } else if (sc->sc_state == SPC_RESELECTED) { | 1212 | } else if (sc->sc_state == SPC_RESELECTED) { | |
1213 | struct scsipi_periph *periph = NULL; | 1213 | struct scsipi_periph *periph = NULL; | |
1214 | struct acb *acb; | 1214 | struct acb *acb; | |
1215 | struct spc_tinfo *ti; | 1215 | struct spc_tinfo *ti; | |
1216 | u_char lunit; | 1216 | u_char lunit; | |
1217 | 1217 | |||
1218 | if (MSG_ISIDENTIFY(sc->sc_imess[0])) { /* Identify? */ | 1218 | if (MSG_ISIDENTIFY(sc->sc_imess[0])) { /* Identify? */ | |
1219 | SPC_MISC(("searching ")); | 1219 | SPC_MISC(("searching ")); | |
1220 | /* | 1220 | /* | |
1221 | * Search wait queue for disconnected cmd | 1221 | * Search wait queue for disconnected cmd | |
1222 | * The list should be short, so I haven't bothered with | 1222 | * The list should be short, so I haven't bothered with | |
1223 | * any more sophisticated structures than a simple | 1223 | * any more sophisticated structures than a simple | |
1224 | * singly linked list. | 1224 | * singly linked list. | |
1225 | */ | 1225 | */ | |
1226 | lunit = sc->sc_imess[0] & 0x07; | 1226 | lunit = sc->sc_imess[0] & 0x07; | |
1227 | TAILQ_FOREACH(acb, &sc->nexus_list, chain) { | 1227 | TAILQ_FOREACH(acb, &sc->nexus_list, chain) { | |
1228 | periph = acb->xs->xs_periph; | 1228 | periph = acb->xs->xs_periph; | |
1229 | if (periph->periph_lun == lunit && | 1229 | if (periph->periph_lun == lunit && | |
1230 | sc->sc_selid == (1<<periph->periph_target)) { | 1230 | sc->sc_selid == (1<<periph->periph_target)) { | |
1231 | TAILQ_REMOVE(&sc->nexus_list, acb, | 1231 | TAILQ_REMOVE(&sc->nexus_list, acb, |
--- src/sys/arch/x68k/dev/mhavar.h 2022/01/01 21:07:14 1.11
+++ src/sys/arch/x68k/dev/mhavar.h 2024/01/07 07:58:33 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mhavar.h,v 1.11 2022/01/01 21:07:14 andvar Exp $ */ | 1 | /* $NetBSD: mhavar.h,v 1.12 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1994 Peter Galbavy. All rights reserved. | 4 | * Copyright (c) 1994 Peter Galbavy. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
@@ -45,27 +45,27 @@ struct acb { | @@ -45,27 +45,27 @@ struct acb { | |||
45 | #define ACB_QFREE 1 | 45 | #define ACB_QFREE 1 | |
46 | #define ACB_QREADY 2 | 46 | #define ACB_QREADY 2 | |
47 | #define ACB_QNEXUS 3 | 47 | #define ACB_QNEXUS 3 | |
48 | 48 | |||
49 | #define ACB_QBITS 0x07 | 49 | #define ACB_QBITS 0x07 | |
50 | #define ACB_CHKSENSE 0x08 | 50 | #define ACB_CHKSENSE 0x08 | |
51 | #define ACB_ABORTED 0x10 | 51 | #define ACB_ABORTED 0x10 | |
52 | #define ACB_RESET 0x80 | 52 | #define ACB_RESET 0x80 | |
53 | #define ACB_SETQ(e, q) do (e)->flags = ((e)->flags&~ACB_QBITS)|(q); while(0) | 53 | #define ACB_SETQ(e, q) do (e)->flags = ((e)->flags&~ACB_QBITS)|(q); while(0) | |
54 | struct scsipi_generic cmd; /* SCSI command block */ | 54 | struct scsipi_generic cmd; /* SCSI command block */ | |
55 | int clen; | 55 | int clen; | |
56 | char *daddr; /* Saved data pointer */ | 56 | char *daddr; /* Saved data pointer */ | |
57 | int dleft; /* Residue */ | 57 | int dleft; /* Residue */ | |
58 | u_char stat; /* SCSI status byte */ | 58 | u_char stat; /* SCSI status byte */ | |
59 | 59 | |||
60 | /* struct spc_dma_seg dma[SPC_NSEG];*/ /* Physical addresses+len */ | 60 | /* struct spc_dma_seg dma[SPC_NSEG];*/ /* Physical addresses+len */ | |
61 | }; | 61 | }; | |
62 | 62 | |||
63 | /* | 63 | /* | |
64 | * Some info about each (possible) target on the SCSI bus. This should | 64 | * Some info about each (possible) target on the SCSI bus. This should | |
65 | * probably have been a "per target+lunit" structure, but we'll leave it at | 65 | * probably have been a "per target+lunit" structure, but we'll leave it at | |
66 | * this for now. | 66 | * this for now. | |
67 | */ | 67 | */ | |
68 | struct spc_tinfo { | 68 | struct spc_tinfo { | |
69 | int cmds; /* #commands processed */ | 69 | int cmds; /* #commands processed */ | |
70 | int dconns; /* #disconnects */ | 70 | int dconns; /* #disconnects */ | |
71 | int touts; /* #timeouts */ | 71 | int touts; /* #timeouts */ | |
@@ -100,38 +100,38 @@ struct mha_softc { | @@ -100,38 +100,38 @@ struct mha_softc { | |||
100 | struct spc_tinfo sc_tinfo[8]; | 100 | struct spc_tinfo sc_tinfo[8]; | |
101 | 101 | |||
102 | /* Data about the current nexus (updated for every cmd switch) */ | 102 | /* Data about the current nexus (updated for every cmd switch) */ | |
103 | u_char *sc_dp; /* Current data pointer */ | 103 | u_char *sc_dp; /* Current data pointer */ | |
104 | size_t sc_dleft; /* Data bytes left to transfer */ | 104 | size_t sc_dleft; /* Data bytes left to transfer */ | |
105 | 105 | |||
106 | u_char *sc_cp; /* Current command pointer */ | 106 | u_char *sc_cp; /* Current command pointer */ | |
107 | size_t sc_cleft; /* Command bytes left to transfer */ | 107 | size_t sc_cleft; /* Command bytes left to transfer */ | |
108 | 108 | |||
109 | /* Adapter state */ | 109 | /* Adapter state */ | |
110 | int sc_phase; /* Copy of what bus phase we are in */ | 110 | int sc_phase; /* Copy of what bus phase we are in */ | |
111 | int sc_prevphase; /* Copy of what bus phase we were in */ | 111 | int sc_prevphase; /* Copy of what bus phase we were in */ | |
112 | u_char sc_state; /* State applicable to the adapter */ | 112 | u_char sc_state; /* State applicable to the adapter */ | |
113 | u_char sc_flags; | 113 | u_char sc_flags; | |
114 | u_char sc_selid; /* Reselection ID */ | 114 | u_char sc_selid; /* Reselection ID */ | |
115 | volatile u_char sc_spcinitialized; /* */ | 115 | volatile u_char sc_spcinitialized; /* */ | |
116 | 116 | |||
117 | /* Message stuff */ | 117 | /* Message stuff */ | |
118 | u_char sc_msgpriq; /* Messages we want to send */ | 118 | u_char sc_msgpriq; /* Messages we want to send */ | |
119 | u_char sc_msgout; /* What message is on its way out? */ | 119 | u_char sc_msgout; /* What message is on its way out? */ | |
120 | u_char sc_msgoutq; /* Messages sent during last MESSAGE OUT */ | 120 | u_char sc_msgoutq; /* Messages sent during last MESSAGE OUT */ | |
121 | u_char sc_lastmsg; /* Message last transmitted */ | 121 | u_char sc_lastmsg; /* Message last transmitted */ | |
122 | u_char sc_currmsg; /* Message currently ready to transmit */ | 122 | u_char sc_currmsg; /* Message currently ready to transmit */ | |
123 | #define SPC_MAX_MSG_LEN 8 | 123 | #define SPC_MAX_MSG_LEN 8 | |
124 | u_char sc_omess[SPC_MAX_MSG_LEN]; | 124 | u_char sc_omess[SPC_MAX_MSG_LEN]; | |
125 | u_char *sc_omp; /* Outgoing message pointer */ | 125 | u_char *sc_omp; /* Outgoing message pointer */ | |
126 | u_char sc_imess[SPC_MAX_MSG_LEN]; | 126 | u_char sc_imess[SPC_MAX_MSG_LEN]; | |
127 | u_char *sc_imp; /* Incoming message pointer */ | 127 | u_char *sc_imp; /* Incoming message pointer */ | |
128 | size_t sc_imlen; | 128 | size_t sc_imlen; | |
129 | 129 | |||
130 | /* Hardware stuff */ | 130 | /* Hardware stuff */ | |
131 | int sc_freq; /* Clock frequency in MHz */ | 131 | int sc_freq; /* Clock frequency in MHz */ | |
132 | int sc_id; /* our scsi id */ | 132 | int sc_id; /* our scsi id */ | |
133 | int sc_minsync; /* Minimum sync period / 4 */ | 133 | int sc_minsync; /* Minimum sync period / 4 */ | |
134 | int sc_maxsync; /* Maximum sync period / 4 */ | 134 | int sc_maxsync; /* Maximum sync period / 4 */ | |
135 | 135 | |||
136 | /* DMA buffer */ | 136 | /* DMA buffer */ | |
137 | bus_dma_tag_t sc_dmat; | 137 | bus_dma_tag_t sc_dmat; | |
@@ -163,27 +163,27 @@ struct mha_softc { | @@ -163,27 +163,27 @@ struct mha_softc { | |||
163 | #define SPC_BUSFREE_OK 0x04 /* Bus free phase is OK. */ | 163 | #define SPC_BUSFREE_OK 0x04 /* Bus free phase is OK. */ | |
164 | #define SPC_SYNCHNEGO 0x08 /* Synch negotiation in progress. */ | 164 | #define SPC_SYNCHNEGO 0x08 /* Synch negotiation in progress. */ | |
165 | #define SPC_DISCON 0x10 /* Target sent DISCONNECT msg */ | 165 | #define SPC_DISCON 0x10 /* Target sent DISCONNECT msg */ | |
166 | #define SPC_ABORTING 0x20 /* Bailing out */ | 166 | #define SPC_ABORTING 0x20 /* Bailing out */ | |
167 | #define ESP_ICCS 0x40 /* Expect status phase results */ | 167 | #define ESP_ICCS 0x40 /* Expect status phase results */ | |
168 | #define ESP_WAITI 0x80 /* Waiting for non-DMA data to arrive */ | 168 | #define ESP_WAITI 0x80 /* Waiting for non-DMA data to arrive */ | |
169 | 169 | |||
170 | 170 | |||
171 | /* values for sc_msgout */ | 171 | /* values for sc_msgout */ | |
172 | #define SEND_DEV_RESET 0x01 | 172 | #define SEND_DEV_RESET 0x01 | |
173 | #define SEND_PARITY_ERROR 0x02 | 173 | #define SEND_PARITY_ERROR 0x02 | |
174 | #define SEND_INIT_DET_ERR 0x04 | 174 | #define SEND_INIT_DET_ERR 0x04 | |
175 | #define SEND_REJECT 0x08 | 175 | #define SEND_REJECT 0x08 | |
176 | #define SEND_IDENTIFY 0x10 | 176 | #define SEND_IDENTIFY 0x10 | |
177 | #define SEND_ABORT 0x20 | 177 | #define SEND_ABORT 0x20 | |
178 | #define SEND_SDTR 0x40 | 178 | #define SEND_SDTR 0x40 | |
179 | #define SEND_WDTR 0x80 | 179 | #define SEND_WDTR 0x80 | |
180 | 180 | |||
181 | /* SCSI Status codes */ | 181 | /* SCSI Status codes */ | |
182 | #define ST_GOOD 0x00 | 182 | #define ST_GOOD 0x00 | |
183 | #define ST_CHKCOND 0x02 | 183 | #define ST_CHKCOND 0x02 | |
184 | #define ST_CONDMET 0x04 | 184 | #define ST_CONDMET 0x04 | |
185 | #define ST_BUSY 0x08 | 185 | #define ST_BUSY 0x08 | |
186 | #define ST_INTERMED 0x10 | 186 | #define ST_INTERMED 0x10 | |
187 | #define ST_INTERMED_CONDMET 0x14 | 187 | #define ST_INTERMED_CONDMET 0x14 | |
188 | #define ST_RESERVATION_CONFLICT 0x18 | 188 | #define ST_RESERVATION_CONFLICT 0x18 | |
189 | #define ST_CMD_TERM 0x22 | 189 | #define ST_CMD_TERM 0x22 |
--- src/sys/arch/x68k/dev/ms.c 2022/05/23 16:58:37 1.40
+++ src/sys/arch/x68k/dev/ms.c 2024/01/07 07:58:33 1.41
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ms.c,v 1.40 2022/05/23 16:58:37 tsutsui Exp $ */ | 1 | /* $NetBSD: ms.c,v 1.41 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1992, 1993 | 4 | * Copyright (c) 1992, 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 software was developed by the Computer Systems Engineering group | 7 | * This software was developed by the Computer Systems Engineering group | |
8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | 8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | |
9 | * contributed to Berkeley. | 9 | * contributed to Berkeley. | |
10 | * | 10 | * | |
11 | * All advertising materials mentioning features or use of this software | 11 | * All advertising materials mentioning features or use of this software | |
12 | * must display the following acknowledgement: | 12 | * must display the following acknowledgement: | |
13 | * This product includes software developed by the University of | 13 | * This product includes software developed by the University of | |
14 | * California, Lawrence Berkeley Laboratory. | 14 | * California, Lawrence Berkeley Laboratory. | |
@@ -35,27 +35,27 @@ | @@ -35,27 +35,27 @@ | |||
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
38 | * SUCH DAMAGE. | 38 | * SUCH DAMAGE. | |
39 | * | 39 | * | |
40 | * @(#)ms.c 8.1 (Berkeley) 6/11/93 | 40 | * @(#)ms.c 8.1 (Berkeley) 6/11/93 | |
41 | */ | 41 | */ | |
42 | 42 | |||
43 | /* | 43 | /* | |
44 | * X68k mouse driver. | 44 | * X68k mouse driver. | |
45 | */ | 45 | */ | |
46 | 46 | |||
47 | #include <sys/cdefs.h> | 47 | #include <sys/cdefs.h> | |
48 | __KERNEL_RCSID(0, "$NetBSD: ms.c,v 1.40 2022/05/23 16:58:37 tsutsui Exp $"); | 48 | __KERNEL_RCSID(0, "$NetBSD: ms.c,v 1.41 2024/01/07 07:58:33 isaki Exp $"); | |
49 | 49 | |||
50 | #include <sys/param.h> | 50 | #include <sys/param.h> | |
51 | #include <sys/conf.h> | 51 | #include <sys/conf.h> | |
52 | #include <sys/ioctl.h> | 52 | #include <sys/ioctl.h> | |
53 | #include <sys/kernel.h> | 53 | #include <sys/kernel.h> | |
54 | #include <sys/proc.h> | 54 | #include <sys/proc.h> | |
55 | #include <sys/syslog.h> | 55 | #include <sys/syslog.h> | |
56 | #include <sys/systm.h> | 56 | #include <sys/systm.h> | |
57 | #include <sys/tty.h> | 57 | #include <sys/tty.h> | |
58 | #include <sys/device.h> | 58 | #include <sys/device.h> | |
59 | #include <sys/signalvar.h> | 59 | #include <sys/signalvar.h> | |
60 | #include <sys/mutex.h> | 60 | #include <sys/mutex.h> | |
61 | 61 | |||
@@ -459,27 +459,27 @@ ms_input(struct ms_softc *ms, int c) | @@ -459,27 +459,27 @@ ms_input(struct ms_softc *ms, int c) | |||
459 | firm_gettime(fe); | 459 | firm_gettime(fe); | |
460 | ADVANCE; | 460 | ADVANCE; | |
461 | ms->ms_dx = 0; | 461 | ms->ms_dx = 0; | |
462 | any++; | 462 | any++; | |
463 | } | 463 | } | |
464 | if (ms->ms_dy) { | 464 | if (ms->ms_dy) { | |
465 | NEXT; | 465 | NEXT; | |
466 | fe->id = LOC_Y_DELTA; | 466 | fe->id = LOC_Y_DELTA; | |
467 | /* | 467 | /* | |
468 | * struct firm_events (derived from SunOS) defines | 468 | * struct firm_events (derived from SunOS) defines | |
469 | * moving up (forward) is positive. (see vuid_event.h) | 469 | * moving up (forward) is positive. (see vuid_event.h) | |
470 | * On the other hand, X680x0 mouse protocol reports | 470 | * On the other hand, X680x0 mouse protocol reports | |
471 | * moving down (backward) is positive. | 471 | * moving down (backward) is positive. | |
472 | * | 472 | * | |
473 | * Note wsmouse(9) also defines moving upward is positive, | 473 | * Note wsmouse(9) also defines moving upward is positive, | |
474 | * but Xorg DIX layer requires moving down is positive. | 474 | * but Xorg DIX layer requires moving down is positive. | |
475 | */ | 475 | */ | |
476 | fe->value = -ms->ms_dy; | 476 | fe->value = -ms->ms_dy; | |
477 | firm_gettime(fe); | 477 | firm_gettime(fe); | |
478 | ADVANCE; | 478 | ADVANCE; | |
479 | ms->ms_dy = 0; | 479 | ms->ms_dy = 0; | |
480 | any++; | 480 | any++; | |
481 | } | 481 | } | |
482 | out: | 482 | out: | |
483 | if (any) { | 483 | if (any) { | |
484 | ms->ms_ub = ub; | 484 | ms->ms_ub = ub; | |
485 | ms->ms_events.ev_put = put; | 485 | ms->ms_events.ev_put = put; |
--- src/sys/arch/x68k/dev/par.c 2022/05/26 14:33:29 1.44
+++ src/sys/arch/x68k/dev/par.c 2024/01/07 07:58:33 1.45
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: par.c,v 1.44 2022/05/26 14:33:29 tsutsui Exp $ */ | 1 | /* $NetBSD: par.c,v 1.45 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1982, 1990 The Regents of the University of California. | 4 | * Copyright (c) 1982, 1990 The Regents of the University of California. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | * | 30 | * | |
31 | * @(#)ppi.c 7.3 (Berkeley) 12/16/90 | 31 | * @(#)ppi.c 7.3 (Berkeley) 12/16/90 | |
32 | */ | 32 | */ | |
33 | 33 | |||
34 | /* | 34 | /* | |
35 | * parallel port interface | 35 | * parallel port interface | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(0, "$NetBSD: par.c,v 1.44 2022/05/26 14:33:29 tsutsui Exp $"); | 39 | __KERNEL_RCSID(0, "$NetBSD: par.c,v 1.45 2024/01/07 07:58:33 isaki Exp $"); | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/errno.h> | 42 | #include <sys/errno.h> | |
43 | #include <sys/uio.h> | 43 | #include <sys/uio.h> | |
44 | #include <sys/device.h> | 44 | #include <sys/device.h> | |
45 | #include <sys/malloc.h> | 45 | #include <sys/malloc.h> | |
46 | #include <sys/file.h> | 46 | #include <sys/file.h> | |
47 | #include <sys/systm.h> | 47 | #include <sys/systm.h> | |
48 | #include <sys/callout.h> | 48 | #include <sys/callout.h> | |
49 | #include <sys/proc.h> | 49 | #include <sys/proc.h> | |
50 | #include <sys/conf.h> | 50 | #include <sys/conf.h> | |
51 | #include <sys/kernel.h> | 51 | #include <sys/kernel.h> | |
52 | 52 | |||
@@ -55,40 +55,40 @@ __KERNEL_RCSID(0, "$NetBSD: par.c,v 1.44 | @@ -55,40 +55,40 @@ __KERNEL_RCSID(0, "$NetBSD: par.c,v 1.44 | |||
55 | #include <machine/parioctl.h> | 55 | #include <machine/parioctl.h> | |
56 | 56 | |||
57 | #include <arch/x68k/dev/intiovar.h> | 57 | #include <arch/x68k/dev/intiovar.h> | |
58 | 58 | |||
59 | #include "ioconf.h" | 59 | #include "ioconf.h" | |
60 | 60 | |||
61 | struct par_softc { | 61 | struct par_softc { | |
62 | device_t sc_dev; | 62 | device_t sc_dev; | |
63 | 63 | |||
64 | bus_space_tag_t sc_bst; | 64 | bus_space_tag_t sc_bst; | |
65 | bus_space_handle_t sc_bsh; | 65 | bus_space_handle_t sc_bsh; | |
66 | int sc_flags; | 66 | int sc_flags; | |
67 | struct parparam sc_param; | 67 | struct parparam sc_param; | |
68 | #define sc_burst sc_param.burst | 68 | #define sc_burst sc_param.burst | |
69 | #define sc_timo sc_param.timo | 69 | #define sc_timo sc_param.timo | |
70 | #define sc_delay sc_param.delay | 70 | #define sc_delay sc_param.delay | |
71 | struct callout sc_timo_ch; | 71 | struct callout sc_timo_ch; | |
72 | struct callout sc_start_ch; | 72 | struct callout sc_start_ch; | |
73 | } ; | 73 | } ; | |
74 | 74 | |||
75 | /* par registers */ | 75 | /* par registers */ | |
76 | #define PAR_DATA 1 | 76 | #define PAR_DATA 1 | |
77 | #define PAR_STROBE 3 | 77 | #define PAR_STROBE 3 | |
78 | 78 | |||
79 | /* sc_flags values */ | 79 | /* sc_flags values */ | |
80 | #define PARF_ALIVE 0x01 | 80 | #define PARF_ALIVE 0x01 | |
81 | #define PARF_OPEN 0x02 | 81 | #define PARF_OPEN 0x02 | |
82 | #define PARF_UIO 0x04 | 82 | #define PARF_UIO 0x04 | |
83 | #define PARF_TIMO 0x08 | 83 | #define PARF_TIMO 0x08 | |
84 | #define PARF_DELAY 0x10 | 84 | #define PARF_DELAY 0x10 | |
85 | #define PARF_OREAD 0x40 /* no support */ | 85 | #define PARF_OREAD 0x40 /* no support */ | |
86 | #define PARF_OWRITE 0x80 | 86 | #define PARF_OWRITE 0x80 | |
87 | 87 | |||
88 | 88 | |||
89 | void partimo(void *); | 89 | void partimo(void *); | |
90 | void parstart(void *); | 90 | void parstart(void *); | |
91 | void parintr(void *); | 91 | void parintr(void *); | |
92 | int parrw(dev_t, struct uio *); | 92 | int parrw(dev_t, struct uio *); | |
93 | int parhztoms(int); | 93 | int parhztoms(int); | |
94 | int parmstohz(int); | 94 | int parmstohz(int); | |
@@ -159,27 +159,27 @@ parmatch(device_t parent, cfdata_t cf, v | @@ -159,27 +159,27 @@ parmatch(device_t parent, cfdata_t cf, v | |||
159 | if (ia->ia_intr != 99) | 159 | if (ia->ia_intr != 99) | |
160 | return 0; | 160 | return 0; | |
161 | #endif | 161 | #endif | |
162 | 162 | |||
163 | return 1; | 163 | return 1; | |
164 | } | 164 | } | |
165 | 165 | |||
166 | void | 166 | void | |
167 | parattach(device_t parent, device_t self, void *aux) | 167 | parattach(device_t parent, device_t self, void *aux) | |
168 | { | 168 | { | |
169 | struct par_softc *sc = device_private(self); | 169 | struct par_softc *sc = device_private(self); | |
170 | struct intio_attach_args *ia = aux; | 170 | struct intio_attach_args *ia = aux; | |
171 | int r __diagused; | 171 | int r __diagused; | |
172 | 172 | |||
173 | par_attached = 1; | 173 | par_attached = 1; | |
174 | 174 | |||
175 | sc->sc_dev = self; | 175 | sc->sc_dev = self; | |
176 | sc->sc_flags = PARF_ALIVE; | 176 | sc->sc_flags = PARF_ALIVE; | |
177 | aprint_normal(": parallel port (write only, interrupt)\n"); | 177 | aprint_normal(": parallel port (write only, interrupt)\n"); | |
178 | ia->ia_size = 0x2000; | 178 | ia->ia_size = 0x2000; | |
179 | r = intio_map_allocate_region(parent, ia, INTIO_MAP_ALLOCATE); | 179 | r = intio_map_allocate_region(parent, ia, INTIO_MAP_ALLOCATE); | |
180 | #ifdef DIAGNOSTIC | 180 | #ifdef DIAGNOSTIC | |
181 | if (r) | 181 | if (r) | |
182 | panic("IO map for PAR corruption??"); | 182 | panic("IO map for PAR corruption??"); | |
183 | #endif | 183 | #endif | |
184 | sc->sc_bst = ia->ia_bst; | 184 | sc->sc_bst = ia->ia_bst; | |
185 | r = bus_space_map(sc->sc_bst, | 185 | r = bus_space_map(sc->sc_bst, | |
@@ -197,54 +197,54 @@ parattach(device_t parent, device_t self | @@ -197,54 +197,54 @@ parattach(device_t parent, device_t self | |||
197 | intio_intr_establish(ia->ia_intr, "par", | 197 | intio_intr_establish(ia->ia_intr, "par", | |
198 | (intio_intr_handler_t)parintr, (void *)1); | 198 | (intio_intr_handler_t)parintr, (void *)1); | |
199 | 199 | |||
200 | callout_init(&sc->sc_timo_ch, 0); | 200 | callout_init(&sc->sc_timo_ch, 0); | |
201 | callout_init(&sc->sc_start_ch, 0); | 201 | callout_init(&sc->sc_start_ch, 0); | |
202 | callout_init(&intr_callout, 0); | 202 | callout_init(&intr_callout, 0); | |
203 | } | 203 | } | |
204 | 204 | |||
205 | int | 205 | int | |
206 | paropen(dev_t dev, int flags, int mode, struct lwp *l) | 206 | paropen(dev_t dev, int flags, int mode, struct lwp *l) | |
207 | { | 207 | { | |
208 | int unit = UNIT(dev); | 208 | int unit = UNIT(dev); | |
209 | struct par_softc *sc; | 209 | struct par_softc *sc; | |
210 | 210 | |||
211 | sc = device_lookup_private(&par_cd, unit); | 211 | sc = device_lookup_private(&par_cd, unit); | |
212 | if (sc == NULL || !(sc->sc_flags & PARF_ALIVE)) | 212 | if (sc == NULL || !(sc->sc_flags & PARF_ALIVE)) | |
213 | return(ENXIO); | 213 | return(ENXIO); | |
214 | if (sc->sc_flags & PARF_OPEN) | 214 | if (sc->sc_flags & PARF_OPEN) | |
215 | return(EBUSY); | 215 | return(EBUSY); | |
216 | /* X680x0 can't read */ | 216 | /* X680x0 can't read */ | |
217 | if ((flags & FREAD) == FREAD) | 217 | if ((flags & FREAD) == FREAD) | |
218 | return (EINVAL); | 218 | return (EINVAL); | |
219 | 219 | |||
220 | sc->sc_flags |= PARF_OPEN; | 220 | sc->sc_flags |= PARF_OPEN; | |
221 | 221 | |||
222 | sc->sc_flags |= PARF_OWRITE; | 222 | sc->sc_flags |= PARF_OWRITE; | |
223 | 223 | |||
224 | sc->sc_burst = PAR_BURST; | 224 | sc->sc_burst = PAR_BURST; | |
225 | sc->sc_timo = parmstohz(PAR_TIMO); | 225 | sc->sc_timo = parmstohz(PAR_TIMO); | |
226 | sc->sc_delay = parmstohz(PAR_DELAY); | 226 | sc->sc_delay = parmstohz(PAR_DELAY); | |
227 | 227 | |||
228 | return(0); | 228 | return(0); | |
229 | } | 229 | } | |
230 | 230 | |||
231 | int | 231 | int | |
232 | parclose(dev_t dev, int flags, int mode, struct lwp *l) | 232 | parclose(dev_t dev, int flags, int mode, struct lwp *l) | |
233 | { | 233 | { | |
234 | int unit = UNIT(dev); | 234 | int unit = UNIT(dev); | |
235 | int s; | 235 | int s; | |
236 | struct par_softc *sc = device_lookup_private(&par_cd, unit); | 236 | struct par_softc *sc = device_lookup_private(&par_cd, unit); | |
237 | 237 | |||
238 | sc->sc_flags &= ~(PARF_OPEN|PARF_OWRITE); | 238 | sc->sc_flags &= ~(PARF_OPEN|PARF_OWRITE); | |
239 | 239 | |||
240 | /* don't allow interrupts any longer */ | 240 | /* don't allow interrupts any longer */ | |
241 | s = spl1(); | 241 | s = spl1(); | |
242 | intio_set_sicilian_intr(intio_get_sicilian_intr() & | 242 | intio_set_sicilian_intr(intio_get_sicilian_intr() & | |
243 | ~SICILIAN_INTR_PAR); | 243 | ~SICILIAN_INTR_PAR); | |
244 | splx(s); | 244 | splx(s); | |
245 | 245 | |||
246 | return (0); | 246 | return (0); | |
247 | } | 247 | } | |
248 | 248 | |||
249 | void | 249 | void | |
250 | parstart(void *arg) | 250 | parstart(void *arg) | |
@@ -263,52 +263,52 @@ partimo(void *arg) | @@ -263,52 +263,52 @@ partimo(void *arg) | |||
263 | { | 263 | { | |
264 | struct par_softc *sc = arg; | 264 | struct par_softc *sc = arg; | |
265 | #ifdef DEBUG | 265 | #ifdef DEBUG | |
266 | if (pardebug & PDB_FOLLOW) | 266 | if (pardebug & PDB_FOLLOW) | |
267 | printf("partimo(%x)\n", device_unit(sc->sc_dev)); | 267 | printf("partimo(%x)\n", device_unit(sc->sc_dev)); | |
268 | #endif | 268 | #endif | |
269 | sc->sc_flags &= ~(PARF_UIO|PARF_TIMO); | 269 | sc->sc_flags &= ~(PARF_UIO|PARF_TIMO); | |
270 | wakeup(sc); | 270 | wakeup(sc); | |
271 | } | 271 | } | |
272 | 272 | |||
273 | int | 273 | int | |
274 | parwrite(dev_t dev, struct uio *uio, int flag) | 274 | parwrite(dev_t dev, struct uio *uio, int flag) | |
275 | { | 275 | { | |
276 | 276 | |||
277 | #ifdef DEBUG | 277 | #ifdef DEBUG | |
278 | if (pardebug & PDB_FOLLOW) | 278 | if (pardebug & PDB_FOLLOW) | |
279 | printf("parwrite(%x, %p)\n", UNIT(dev), uio); | 279 | printf("parwrite(%x, %p)\n", UNIT(dev), uio); | |
280 | #endif | 280 | #endif | |
281 | return (parrw(dev, uio)); | 281 | return (parrw(dev, uio)); | |
282 | } | 282 | } | |
283 | 283 | |||
284 | int | 284 | int | |
285 | parrw(dev_t dev, struct uio *uio) | 285 | parrw(dev_t dev, struct uio *uio) | |
286 | { | 286 | { | |
287 | int unit = UNIT(dev); | 287 | int unit = UNIT(dev); | |
288 | struct par_softc *sc = device_lookup_private(&par_cd, unit); | 288 | struct par_softc *sc = device_lookup_private(&par_cd, unit); | |
289 | int len=0xdeadbeef; /* XXX: shutup gcc */ | 289 | int len=0xdeadbeef; /* XXX: shutup gcc */ | |
290 | int s, cnt=0; | 290 | int s, cnt=0; | |
291 | char *cp; | 291 | char *cp; | |
292 | int error = 0; | 292 | int error = 0; | |
293 | int buflen; | 293 | int buflen; | |
294 | char *buf; | 294 | char *buf; | |
295 | 295 | |||
296 | if (!!(sc->sc_flags & PARF_OREAD) ^ (uio->uio_rw == UIO_READ)) | 296 | if (!!(sc->sc_flags & PARF_OREAD) ^ (uio->uio_rw == UIO_READ)) | |
297 | return EINVAL; | 297 | return EINVAL; | |
298 | 298 | |||
299 | if (uio->uio_resid == 0) | 299 | if (uio->uio_resid == 0) | |
300 | return(0); | 300 | return(0); | |
301 | 301 | |||
302 | buflen = uimin(sc->sc_burst, uio->uio_resid); | 302 | buflen = uimin(sc->sc_burst, uio->uio_resid); | |
303 | buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK); | 303 | buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK); | |
304 | sc->sc_flags |= PARF_UIO; | 304 | sc->sc_flags |= PARF_UIO; | |
305 | if (sc->sc_timo > 0) { | 305 | if (sc->sc_timo > 0) { | |
306 | sc->sc_flags |= PARF_TIMO; | 306 | sc->sc_flags |= PARF_TIMO; | |
307 | callout_reset(&sc->sc_timo_ch, sc->sc_timo, partimo, sc); | 307 | callout_reset(&sc->sc_timo_ch, sc->sc_timo, partimo, sc); | |
308 | } | 308 | } | |
309 | while (uio->uio_resid > 0) { | 309 | while (uio->uio_resid > 0) { | |
310 | len = uimin(buflen, uio->uio_resid); | 310 | len = uimin(buflen, uio->uio_resid); | |
311 | cp = buf; | 311 | cp = buf; | |
312 | if (uio->uio_rw == UIO_WRITE) { | 312 | if (uio->uio_rw == UIO_WRITE) { | |
313 | error = uiomove(cp, len, uio); | 313 | error = uiomove(cp, len, uio); | |
314 | if (error) | 314 | if (error) | |
@@ -331,27 +331,27 @@ parrw(dev_t dev, struct uio *uio) | @@ -331,27 +331,27 @@ parrw(dev_t dev, struct uio *uio) | |||
331 | } | 331 | } | |
332 | splx(s); | 332 | splx(s); | |
333 | break; | 333 | break; | |
334 | } | 334 | } | |
335 | splx(s); | 335 | splx(s); | |
336 | /* | 336 | /* | |
337 | * Perform the operation | 337 | * Perform the operation | |
338 | */ | 338 | */ | |
339 | cnt = parsend(sc, cp, len); | 339 | cnt = parsend(sc, cp, len); | |
340 | if (cnt < 0) { | 340 | if (cnt < 0) { | |
341 | error = -cnt; | 341 | error = -cnt; | |
342 | break; | 342 | break; | |
343 | } | 343 | } | |
344 | 344 | |||
345 | s = splsoftclock(); | 345 | s = splsoftclock(); | |
346 | /* | 346 | /* | |
347 | * Operation timeout (or non-blocking), quit now. | 347 | * Operation timeout (or non-blocking), quit now. | |
348 | */ | 348 | */ | |
349 | if ((sc->sc_flags & PARF_UIO) == 0) { | 349 | if ((sc->sc_flags & PARF_UIO) == 0) { | |
350 | #ifdef DEBUG | 350 | #ifdef DEBUG | |
351 | if (pardebug & PDB_IO) | 351 | if (pardebug & PDB_IO) | |
352 | printf("parrw: timeout/done\n"); | 352 | printf("parrw: timeout/done\n"); | |
353 | #endif | 353 | #endif | |
354 | splx(s); | 354 | splx(s); | |
355 | break; | 355 | break; | |
356 | } | 356 | } | |
357 | /* | 357 | /* | |
@@ -408,68 +408,68 @@ parrw(dev_t dev, struct uio *uio) | @@ -408,68 +408,68 @@ parrw(dev_t dev, struct uio *uio) | |||
408 | #ifdef DEBUG | 408 | #ifdef DEBUG | |
409 | if (pardebug & (PDB_FOLLOW|PDB_IO)) | 409 | if (pardebug & (PDB_FOLLOW|PDB_IO)) | |
410 | printf("parrw: return %d, resid %d\n", error, uio->uio_resid); | 410 | printf("parrw: return %d, resid %d\n", error, uio->uio_resid); | |
411 | #endif | 411 | #endif | |
412 | return (error); | 412 | return (error); | |
413 | } | 413 | } | |
414 | 414 | |||
415 | int | 415 | int | |
416 | parioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) | 416 | parioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) | |
417 | { | 417 | { | |
418 | struct par_softc *sc = device_lookup_private(&par_cd, UNIT(dev)); | 418 | struct par_softc *sc = device_lookup_private(&par_cd, UNIT(dev)); | |
419 | struct parparam *pp, *upp; | 419 | struct parparam *pp, *upp; | |
420 | int error = 0; | 420 | int error = 0; | |
421 | 421 | |||
422 | switch (cmd) { | 422 | switch (cmd) { | |
423 | case PARIOCGPARAM: | 423 | case PARIOCGPARAM: | |
424 | pp = &sc->sc_param; | 424 | pp = &sc->sc_param; | |
425 | upp = (struct parparam *)data; | 425 | upp = (struct parparam *)data; | |
426 | upp->burst = pp->burst; | 426 | upp->burst = pp->burst; | |
427 | upp->timo = parhztoms(pp->timo); | 427 | upp->timo = parhztoms(pp->timo); | |
428 | upp->delay = parhztoms(pp->delay); | 428 | upp->delay = parhztoms(pp->delay); | |
429 | break; | 429 | break; | |
430 | 430 | |||
431 | case PARIOCSPARAM: | 431 | case PARIOCSPARAM: | |
432 | pp = &sc->sc_param; | 432 | pp = &sc->sc_param; | |
433 | upp = (struct parparam *)data; | 433 | upp = (struct parparam *)data; | |
434 | if (upp->burst < PAR_BURST_MIN || upp->burst > PAR_BURST_MAX || | 434 | if (upp->burst < PAR_BURST_MIN || upp->burst > PAR_BURST_MAX || | |
435 | upp->delay < PAR_DELAY_MIN || upp->delay > PAR_DELAY_MAX) | 435 | upp->delay < PAR_DELAY_MIN || upp->delay > PAR_DELAY_MAX) | |
436 | return(EINVAL); | 436 | return(EINVAL); | |
437 | pp->burst = upp->burst; | 437 | pp->burst = upp->burst; | |
438 | pp->timo = parmstohz(upp->timo); | 438 | pp->timo = parmstohz(upp->timo); | |
439 | pp->delay = parmstohz(upp->delay); | 439 | pp->delay = parmstohz(upp->delay); | |
440 | break; | 440 | break; | |
441 | 441 | |||
442 | default: | 442 | default: | |
443 | return(EINVAL); | 443 | return(EINVAL); | |
444 | } | 444 | } | |
445 | return (error); | 445 | return (error); | |
446 | } | 446 | } | |
447 | 447 | |||
448 | int | 448 | int | |
449 | parhztoms(int h) | 449 | parhztoms(int h) | |
450 | { | 450 | { | |
451 | int m = h; | 451 | int m = h; | |
452 | 452 | |||
453 | if (m > 0) | 453 | if (m > 0) | |
454 | m = m * 1000 / hz; | 454 | m = m * 1000 / hz; | |
455 | return(m); | 455 | return(m); | |
456 | } | 456 | } | |
457 | 457 | |||
458 | int | 458 | int | |
459 | parmstohz(int m) | 459 | parmstohz(int m) | |
460 | { | 460 | { | |
461 | int h = m; | 461 | int h = m; | |
462 | 462 | |||
463 | if (h > 0) { | 463 | if (h > 0) { | |
464 | h = h * hz / 1000; | 464 | h = h * hz / 1000; | |
465 | if (h == 0) | 465 | if (h == 0) | |
466 | h = 1000 / hz; | 466 | h = 1000 / hz; | |
467 | } | 467 | } | |
468 | return(h); | 468 | return(h); | |
469 | } | 469 | } | |
470 | 470 | |||
471 | /* stuff below here if for interrupt driven output of data thru | 471 | /* stuff below here if for interrupt driven output of data thru | |
472 | the parallel port. */ | 472 | the parallel port. */ | |
473 | 473 | |||
474 | int partimeout_pending; | 474 | int partimeout_pending; | |
475 | int parsend_pending; | 475 | int parsend_pending; | |
@@ -489,40 +489,40 @@ parintr(void *arg) | @@ -489,40 +489,40 @@ parintr(void *arg) | |||
489 | if (pardebug & PDB_INTERRUPT) | 489 | if (pardebug & PDB_INTERRUPT) | |
490 | printf("parintr %d(%s)\n", mask, mask ? "FLG" : "tout"); | 490 | printf("parintr %d(%s)\n", mask, mask ? "FLG" : "tout"); | |
491 | #endif | 491 | #endif | |
492 | /* if invoked from timeout handler, mask will be 0, | 492 | /* if invoked from timeout handler, mask will be 0, | |
493 | * if from interrupt, it will contain the cia-icr mask, | 493 | * if from interrupt, it will contain the cia-icr mask, | |
494 | * which is != 0 | 494 | * which is != 0 | |
495 | */ | 495 | */ | |
496 | if (mask) { | 496 | if (mask) { | |
497 | if (partimeout_pending) | 497 | if (partimeout_pending) | |
498 | callout_stop(&intr_callout); | 498 | callout_stop(&intr_callout); | |
499 | if (parsend_pending) | 499 | if (parsend_pending) | |
500 | parsend_pending = 0; | 500 | parsend_pending = 0; | |
501 | } | 501 | } | |
502 | 502 | |||
503 | /* either way, there won't be a timeout pending any longer */ | 503 | /* either way, there won't be a timeout pending any longer */ | |
504 | partimeout_pending = 0; | 504 | partimeout_pending = 0; | |
505 | 505 | |||
506 | wakeup(parintr); | 506 | wakeup(parintr); | |
507 | splx(s); | 507 | splx(s); | |
508 | } | 508 | } | |
509 | 509 | |||
510 | int | 510 | int | |
511 | parsendch(struct par_softc *sc, u_char ch) | 511 | parsendch(struct par_softc *sc, u_char ch) | |
512 | { | 512 | { | |
513 | int error = 0; | 513 | int error = 0; | |
514 | int s; | 514 | int s; | |
515 | 515 | |||
516 | /* if either offline, busy or out of paper, wait for that | 516 | /* if either offline, busy or out of paper, wait for that | |
517 | condition to clear */ | 517 | condition to clear */ | |
518 | s = spl1(); | 518 | s = spl1(); | |
519 | while (!error | 519 | while (!error | |
520 | && (parsend_pending | 520 | && (parsend_pending | |
521 | || !(intio_get_sicilian_intr() & SICILIAN_STAT_PAR))) | 521 | || !(intio_get_sicilian_intr() & SICILIAN_STAT_PAR))) | |
522 | { | 522 | { | |
523 | /* wait a second, and try again */ | 523 | /* wait a second, and try again */ | |
524 | callout_reset(&intr_callout, hz, parintr, 0); | 524 | callout_reset(&intr_callout, hz, parintr, 0); | |
525 | partimeout_pending = 1; | 525 | partimeout_pending = 1; | |
526 | /* this is essentially a flipflop to have us wait for the | 526 | /* this is essentially a flipflop to have us wait for the | |
527 | first character being transmitted when trying to transmit | 527 | first character being transmitted when trying to transmit | |
528 | the second, etc. */ | 528 | the second, etc. */ | |
@@ -546,32 +546,32 @@ parsendch(struct par_softc *sc, u_char c | @@ -546,32 +546,32 @@ parsendch(struct par_softc *sc, u_char c | |||
546 | #ifdef DEBUG | 546 | #ifdef DEBUG | |
547 | if (pardebug & PDB_INTERRUPT) | 547 | if (pardebug & PDB_INTERRUPT) | |
548 | printf("#%d", ch); | 548 | printf("#%d", ch); | |
549 | #endif | 549 | #endif | |
550 | bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_DATA, ch); | 550 | bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_DATA, ch); | |
551 | DELAY(1); /* (DELAY(1) == 1us) > 0.5us */ | 551 | DELAY(1); /* (DELAY(1) == 1us) > 0.5us */ | |
552 | bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_STROBE, 0); | 552 | bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_STROBE, 0); | |
553 | intio_set_sicilian_intr(intio_get_sicilian_intr() | | 553 | intio_set_sicilian_intr(intio_get_sicilian_intr() | | |
554 | SICILIAN_INTR_PAR); | 554 | SICILIAN_INTR_PAR); | |
555 | DELAY(1); | 555 | DELAY(1); | |
556 | bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_STROBE, 1); | 556 | bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_STROBE, 1); | |
557 | parsend_pending = 1; | 557 | parsend_pending = 1; | |
558 | } | 558 | } | |
559 | 559 | |||
560 | splx(s); | 560 | splx(s); | |
561 | 561 | |||
562 | return error; | 562 | return error; | |
563 | } | 563 | } | |
564 | 564 | |||
565 | 565 | |||
566 | int | 566 | int | |
567 | parsend(struct par_softc *sc, u_char *buf, int len) | 567 | parsend(struct par_softc *sc, u_char *buf, int len) | |
568 | { | 568 | { | |
569 | int err, orig_len = len; | 569 | int err, orig_len = len; | |
570 | 570 | |||
571 | for (; len; len--, buf++) | 571 | for (; len; len--, buf++) | |
572 | if ((err = parsendch(sc, *buf))) | 572 | if ((err = parsendch(sc, *buf))) | |
573 | return err < 0 ? -EINTR : -err; | 573 | return err < 0 ? -EINTR : -err; | |
574 | 574 | |||
575 | /* either all or nothing.. */ | 575 | /* either all or nothing.. */ | |
576 | return orig_len; | 576 | return orig_len; | |
577 | } | 577 | } |
--- src/sys/arch/x68k/dev/scsiromvar.h 2008/06/25 08:14:59 1.6
+++ src/sys/arch/x68k/dev/scsiromvar.h 2024/01/07 07:58:33 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: scsiromvar.h,v 1.6 2008/06/25 08:14:59 isaki Exp $ */ | 1 | /* $NetBSD: scsiromvar.h,v 1.7 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -31,18 +31,18 @@ | @@ -31,18 +31,18 @@ | |||
31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
32 | * POSSIBILITY OF SUCH DAMAGE. | 32 | * POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | /* | 35 | /* | |
36 | * SCSI BIOS ROM. | 36 | * SCSI BIOS ROM. | |
37 | * Used to probe the board. | 37 | * Used to probe the board. | |
38 | */ | 38 | */ | |
39 | 39 | |||
40 | struct scsirom_softc { | 40 | struct scsirom_softc { | |
41 | enum { | 41 | enum { | |
42 | INTERNAL = 0, /* onboard */ | 42 | INTERNAL = 0, /* onboard */ | |
43 | EXTERNAL = 1, /* optional */ | 43 | EXTERNAL = 1, /* optional */ | |
44 | } sc_which; | 44 | } sc_which; | |
45 | paddr_t sc_addr; | 45 | paddr_t sc_addr; | |
46 | }; | 46 | }; | |
47 | 47 | |||
48 | int scsirom_find_rom(int); | 48 | int scsirom_find_rom(int); |
--- src/sys/arch/x68k/dev/slhci_intio.c 2016/04/23 10:15:30 1.15
+++ src/sys/arch/x68k/dev/slhci_intio.c 2024/01/07 07:58:33 1.16
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: slhci_intio.c,v 1.15 2016/04/23 10:15:30 skrll Exp $ */ | 1 | /* $NetBSD: slhci_intio.c,v 1.16 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2001 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Tetsuya Isaki. | 8 | * by Tetsuya Isaki. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * USB part of Nereid Ethernet/USB/Memory board | 33 | * USB part of Nereid Ethernet/USB/Memory board | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: slhci_intio.c,v 1.15 2016/04/23 10:15:30 skrll Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: slhci_intio.c,v 1.16 2024/01/07 07:58:33 isaki Exp $"); | |
38 | 38 | |||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/systm.h> | 40 | #include <sys/systm.h> | |
41 | #include <sys/device.h> | 41 | #include <sys/device.h> | |
42 | 42 | |||
43 | #include <machine/bus.h> | 43 | #include <machine/bus.h> | |
44 | #include <machine/cpu.h> | 44 | #include <machine/cpu.h> | |
45 | 45 | |||
46 | #include <dev/usb/usb.h> | 46 | #include <dev/usb/usb.h> | |
47 | #include <dev/usb/usbdi.h> | 47 | #include <dev/usb/usbdi.h> | |
48 | #include <dev/usb/usbdivar.h> | 48 | #include <dev/usb/usbdivar.h> | |
49 | 49 | |||
50 | #include <dev/ic/sl811hsreg.h> | 50 | #include <dev/ic/sl811hsreg.h> | |
@@ -53,27 +53,27 @@ __KERNEL_RCSID(0, "$NetBSD: slhci_intio. | @@ -53,27 +53,27 @@ __KERNEL_RCSID(0, "$NetBSD: slhci_intio. | |||
53 | #include <arch/x68k/dev/intiovar.h> | 53 | #include <arch/x68k/dev/intiovar.h> | |
54 | 54 | |||
55 | #include <arch/x68k/dev/slhci_intio_var.h> | 55 | #include <arch/x68k/dev/slhci_intio_var.h> | |
56 | 56 | |||
57 | static int slhci_intio_match(device_t, cfdata_t, void *); | 57 | static int slhci_intio_match(device_t, cfdata_t, void *); | |
58 | static void slhci_intio_attach(device_t, device_t, void *); | 58 | static void slhci_intio_attach(device_t, device_t, void *); | |
59 | static void slhci_intio_enable_power(void *, enum power_change); | 59 | static void slhci_intio_enable_power(void *, enum power_change); | |
60 | static void slhci_intio_enable_intr(void *, int); | 60 | static void slhci_intio_enable_intr(void *, int); | |
61 | 61 | |||
62 | CFATTACH_DECL_NEW(slhci_intio, sizeof(struct slhci_intio_softc), | 62 | CFATTACH_DECL_NEW(slhci_intio, sizeof(struct slhci_intio_softc), | |
63 | slhci_intio_match, slhci_intio_attach, NULL, NULL); | 63 | slhci_intio_match, slhci_intio_attach, NULL, NULL); | |
64 | 64 | |||
65 | #define INTR_ON 1 | 65 | #define INTR_ON 1 | |
66 | #define INTR_OFF 0 | 66 | #define INTR_OFF 0 | |
67 | 67 | |||
68 | static int | 68 | static int | |
69 | slhci_intio_match(device_t parent, cfdata_t cf, void *aux) | 69 | slhci_intio_match(device_t parent, cfdata_t cf, void *aux) | |
70 | { | 70 | { | |
71 | struct intio_attach_args *ia = aux; | 71 | struct intio_attach_args *ia = aux; | |
72 | bus_space_tag_t iot = ia->ia_bst; | 72 | bus_space_tag_t iot = ia->ia_bst; | |
73 | bus_space_handle_t ioh; | 73 | bus_space_handle_t ioh; | |
74 | bus_space_handle_t nch; | 74 | bus_space_handle_t nch; | |
75 | int nc_addr; | 75 | int nc_addr; | |
76 | int nc_size; | 76 | int nc_size; | |
77 | 77 | |||
78 | if (ia->ia_addr == INTIOCF_ADDR_DEFAULT) | 78 | if (ia->ia_addr == INTIOCF_ADDR_DEFAULT) | |
79 | ia->ia_addr = SLHCI_INTIO_ADDR1; | 79 | ia->ia_addr = SLHCI_INTIO_ADDR1; | |
@@ -137,27 +137,27 @@ slhci_intio_attach(device_t parent, devi | @@ -137,27 +137,27 @@ slhci_intio_attach(device_t parent, devi | |||
137 | return; | 137 | return; | |
138 | } | 138 | } | |
139 | 139 | |||
140 | nc_addr = ia->ia_addr + NEREID_ADDR_OFFSET; | 140 | nc_addr = ia->ia_addr + NEREID_ADDR_OFFSET; | |
141 | nc_size = 0x02; | 141 | nc_size = 0x02; | |
142 | if (bus_space_map(iot, nc_addr, nc_size, | 142 | if (bus_space_map(iot, nc_addr, nc_size, | |
143 | BUS_SPACE_MAP_SHIFTED, &isc->sc_nch)) { | 143 | BUS_SPACE_MAP_SHIFTED, &isc->sc_nch)) { | |
144 | printf("%s: can't map I/O control space\n", | 144 | printf("%s: can't map I/O control space\n", | |
145 | device_xname(self)); | 145 | device_xname(self)); | |
146 | return; | 146 | return; | |
147 | } | 147 | } | |
148 | 148 | |||
149 | /* Initialize sc */ | 149 | /* Initialize sc */ | |
150 | slhci_preinit(sc, slhci_intio_enable_power, iot, ioh, 30, | 150 | slhci_preinit(sc, slhci_intio_enable_power, iot, ioh, 30, | |
151 | SL11_IDX_DATA); | 151 | SL11_IDX_DATA); | |
152 | 152 | |||
153 | /* Establish the interrupt handler */ | 153 | /* Establish the interrupt handler */ | |
154 | if (intio_intr_establish(ia->ia_intr, "slhci", slhci_intr, sc)) { | 154 | if (intio_intr_establish(ia->ia_intr, "slhci", slhci_intr, sc)) { | |
155 | printf("%s: can't establish interrupt\n", | 155 | printf("%s: can't establish interrupt\n", | |
156 | device_xname(self)); | 156 | device_xname(self)); | |
157 | return; | 157 | return; | |
158 | } | 158 | } | |
159 | 159 | |||
160 | /* Reset controller */ | 160 | /* Reset controller */ | |
161 | bus_space_write_1(iot, isc->sc_nch, NEREID_CTRL, NEREID_CTRL_RESET); | 161 | bus_space_write_1(iot, isc->sc_nch, NEREID_CTRL, NEREID_CTRL_RESET); | |
162 | delay(40000); | 162 | delay(40000); | |
163 | 163 |
--- src/sys/arch/x68k/dev/sram.c 2022/05/26 14:33:29 1.21
+++ src/sys/arch/x68k/dev/sram.c 2024/01/07 07:58:33 1.22
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: sram.c,v 1.21 2022/05/26 14:33:29 tsutsui Exp $ */ | 1 | /* $NetBSD: sram.c,v 1.22 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1994 Kazuhisa Shimizu. | 4 | * Copyright (c) 1994 Kazuhisa Shimizu. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: sram.c,v 1.21 2022/05/26 14:33:29 tsutsui Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: sram.c,v 1.22 2024/01/07 07:58:33 isaki Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/proc.h> | 38 | #include <sys/proc.h> | |
39 | #include <sys/ioctl.h> | 39 | #include <sys/ioctl.h> | |
40 | #include <sys/file.h> | 40 | #include <sys/file.h> | |
41 | #include <sys/conf.h> | 41 | #include <sys/conf.h> | |
42 | #include <sys/bus.h> | 42 | #include <sys/bus.h> | |
43 | #include <sys/device.h> | 43 | #include <sys/device.h> | |
44 | 44 | |||
45 | #include <machine/sram.h> | 45 | #include <machine/sram.h> | |
46 | #include <x68k/dev/intiovar.h> | 46 | #include <x68k/dev/intiovar.h> | |
47 | #include <x68k/dev/sramvar.h> | 47 | #include <x68k/dev/sramvar.h> | |
@@ -208,29 +208,29 @@ sramioctl(dev_t dev, u_long cmd, void *d | @@ -208,29 +208,29 @@ sramioctl(dev_t dev, u_long cmd, void *d | |||
208 | DPRINTF(SRAM_DEBUG_IOCTL, | 208 | DPRINTF(SRAM_DEBUG_IOCTL, | |
209 | ("Sram ioctl SIOGSRAM address=%p\n", data)); | 209 | ("Sram ioctl SIOGSRAM address=%p\n", data)); | |
210 | DPRINTF(SRAM_DEBUG_IOCTL, | 210 | DPRINTF(SRAM_DEBUG_IOCTL, | |
211 | ("Sram ioctl SIOGSRAM offset=%x\n", sram_io->offset)); | 211 | ("Sram ioctl SIOGSRAM offset=%x\n", sram_io->offset)); | |
212 | if (sram_io->offset + SRAM_IO_SIZE > SRAM_SIZE) | 212 | if (sram_io->offset + SRAM_IO_SIZE > SRAM_SIZE) | |
213 | return EFAULT; | 213 | return EFAULT; | |
214 | bus_space_read_region_1(sc->sc_iot, sc->sc_ioh, sram_io->offset, | 214 | bus_space_read_region_1(sc->sc_iot, sc->sc_ioh, sram_io->offset, | |
215 | (uint8_t *)&sram_io->sram, SRAM_IO_SIZE); | 215 | (uint8_t *)&sram_io->sram, SRAM_IO_SIZE); | |
216 | break; | 216 | break; | |
217 | case SIOPSRAM: | 217 | case SIOPSRAM: | |
218 | if ((sc->sc_flags & SRF_WRITE) == 0) | 218 | if ((sc->sc_flags & SRF_WRITE) == 0) | |
219 | return EPERM; | 219 | return EPERM; | |
220 | DPRINTF(SRAM_DEBUG_IOCTL, | 220 | DPRINTF(SRAM_DEBUG_IOCTL, | |
221 | ("Sram ioctl SIOPSRAM address=%p\n", data)); | 221 | ("Sram ioctl SIOPSRAM address=%p\n", data)); | |
222 | DPRINTF(SRAM_DEBUG_IOCTL, | 222 | DPRINTF(SRAM_DEBUG_IOCTL, | |
223 | ("Sram ioctl SIOPSRAM offset=%x\n", sram_io->offset)); | 223 | ("Sram ioctl SIOPSRAM offset=%x\n", sram_io->offset)); | |
224 | if (sram_io->offset + SRAM_IO_SIZE > SRAM_SIZE) | 224 | if (sram_io->offset + SRAM_IO_SIZE > SRAM_SIZE) | |
225 | return EFAULT; | 225 | return EFAULT; | |
226 | #ifdef DEBUG | 226 | #ifdef DEBUG | |
227 | if (sramdebug & SRAM_DEBUG_DONTDOIT) { | 227 | if (sramdebug & SRAM_DEBUG_DONTDOIT) { | |
228 | printf("Sram ioctl SIOPSRAM: skipping actual write\n"); | 228 | printf("Sram ioctl SIOPSRAM: skipping actual write\n"); | |
229 | break; | 229 | break; | |
230 | } | 230 | } | |
231 | #endif | 231 | #endif | |
232 | intio_set_sysport_sramwp(0x31); | 232 | intio_set_sysport_sramwp(0x31); | |
233 | bus_space_write_region_1(sc->sc_iot, sc->sc_ioh, | 233 | bus_space_write_region_1(sc->sc_iot, sc->sc_ioh, | |
234 | sram_io->offset, (uint8_t *)&sram_io->sram, | 234 | sram_io->offset, (uint8_t *)&sram_io->sram, | |
235 | SRAM_IO_SIZE); | 235 | SRAM_IO_SIZE); | |
236 | intio_set_sysport_sramwp(0x00); | 236 | intio_set_sysport_sramwp(0x00); |
--- src/sys/arch/x68k/include/cpu.h 2019/11/23 19:40:37 1.62
+++ src/sys/arch/x68k/include/cpu.h 2024/01/07 07:58:33 1.63
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: cpu.h,v 1.62 2019/11/23 19:40:37 ad Exp $ */ | 1 | /* $NetBSD: cpu.h,v 1.63 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988 University of Utah. | 4 | * Copyright (c) 1988 University of Utah. | |
5 | * Copyright (c) 1982, 1990, 1993 | 5 | * Copyright (c) 1982, 1990, 1993 | |
6 | * The Regents of the University of California. All rights reserved. | 6 | * The Regents of the University of California. All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department. | 10 | * Science Department. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -79,27 +79,27 @@ struct clockframe { | @@ -79,27 +79,27 @@ struct clockframe { | |||
79 | /* We would like to do it this way... */ | 79 | /* We would like to do it this way... */ | |
80 | #define CLKF_INTR(framep) (((framep)->sr & PSL_M) == 0) | 80 | #define CLKF_INTR(framep) (((framep)->sr & PSL_M) == 0) | |
81 | #else | 81 | #else | |
82 | /* but until we start using PSL_M, we have to do this instead */ | 82 | /* but until we start using PSL_M, we have to do this instead */ | |
83 | #define CLKF_INTR(framep) (0) /* XXX */ | 83 | #define CLKF_INTR(framep) (0) /* XXX */ | |
84 | #endif | 84 | #endif | |
85 | 85 | |||
86 | 86 | |||
87 | /* | 87 | /* | |
88 | * Preempt the current process if in interrupt from user mode, | 88 | * Preempt the current process if in interrupt from user mode, | |
89 | * or after the current trap/syscall if in system mode. | 89 | * or after the current trap/syscall if in system mode. | |
90 | */ | 90 | */ | |
91 | #define cpu_need_resched(ci,l,flags) do { \ | 91 | #define cpu_need_resched(ci,l,flags) do { \ | |
92 | __USE(flags); \ | 92 | __USE(flags); \ | |
93 | aston(); \ | 93 | aston(); \ | |
94 | } while (/*CONSTCOND*/0) | 94 | } while (/*CONSTCOND*/0) | |
95 | 95 | |||
96 | /* | 96 | /* | |
97 | * Give a profiling tick to the current process when the user profiling | 97 | * Give a profiling tick to the current process when the user profiling | |
98 | * buffer pages are invalid. On the x68k, request an ast to send us | 98 | * buffer pages are invalid. On the x68k, request an ast to send us | |
99 | * through trap, marking the proc as needing a profiling tick. | 99 | * through trap, marking the proc as needing a profiling tick. | |
100 | */ | 100 | */ | |
101 | #define cpu_need_proftick(l) \ | 101 | #define cpu_need_proftick(l) \ | |
102 | do { (l)->l_pflag |= LP_OWEUPC; aston(); } while (/* CONSTCOND */ 0) | 102 | do { (l)->l_pflag |= LP_OWEUPC; aston(); } while (/* CONSTCOND */ 0) | |
103 | 103 | |||
104 | /* | 104 | /* | |
105 | * Notify the current process (p) that it has a signal pending, | 105 | * Notify the current process (p) that it has a signal pending, |
--- src/sys/arch/x68k/include/disklabel.h 2011/08/30 12:39:59 1.6
+++ src/sys/arch/x68k/include/disklabel.h 2024/01/07 07:58:33 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: disklabel.h,v 1.6 2011/08/30 12:39:59 bouyer Exp $ */ | 1 | /* $NetBSD: disklabel.h,v 1.7 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1994 Masaru Oki | 4 | * Copyright (c) 1994 Masaru Oki | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -36,30 +36,30 @@ | @@ -36,30 +36,30 @@ | |||
36 | #define LABELUSESMBR 0 /* no MBR partitionning */ | 36 | #define LABELUSESMBR 0 /* no MBR partitionning */ | |
37 | #define LABELSECTOR 0 /* sector containing label */ | 37 | #define LABELSECTOR 0 /* sector containing label */ | |
38 | #define LABELOFFSET 64 /* offset of label in sector */ | 38 | #define LABELOFFSET 64 /* offset of label in sector */ | |
39 | #define MAXPARTITIONS 8 /* number of partitions */ | 39 | #define MAXPARTITIONS 8 /* number of partitions */ | |
40 | #define RAW_PART 2 /* raw partition: xx?c */ | 40 | #define RAW_PART 2 /* raw partition: xx?c */ | |
41 | 41 | |||
42 | /* DOS partition table -- located in boot block */ | 42 | /* DOS partition table -- located in boot block */ | |
43 | 43 | |||
44 | #define DOSBBSECTOR 0 | 44 | #define DOSBBSECTOR 0 | |
45 | #define DOSPARTOFF 4 | 45 | #define DOSPARTOFF 4 | |
46 | #define NDOSPART 8 | 46 | #define NDOSPART 8 | |
47 | 47 | |||
48 | struct dos_partition { | 48 | struct dos_partition { | |
49 | unsigned char dp_typname[8]; /* partition name */ | 49 | unsigned char dp_typname[8]; /* partition name */ | |
50 | unsigned int dp_flag:8; /* state of partition */ | 50 | unsigned int dp_flag:8; /* state of partition */ | |
51 | unsigned int dp_start:24; /* start position (1024bytes/block) */ | 51 | unsigned int dp_start:24; /* start position (1024bytes/block) */ | |
52 | unsigned long dp_size; /* partition size (1024bytes/block) */ | 52 | unsigned long dp_size; /* partition size (1024bytes/block) */ | |
53 | }; | 53 | }; | |
54 | 54 | |||
55 | #if HAVE_NBTOOL_CONFIG_H | 55 | #if HAVE_NBTOOL_CONFIG_H | |
56 | #include <nbinclude/sys/dkbad.h> | 56 | #include <nbinclude/sys/dkbad.h> | |
57 | #else | 57 | #else | |
58 | #include <sys/dkbad.h> | 58 | #include <sys/dkbad.h> | |
59 | #endif /* HAVE_NBTOOL_CONFIG_H */ | 59 | #endif /* HAVE_NBTOOL_CONFIG_H */ | |
60 | struct cpu_disklabel { | 60 | struct cpu_disklabel { | |
61 | struct dos_partition dosparts[NDOSPART]; | 61 | struct dos_partition dosparts[NDOSPART]; | |
62 | #define __HAVE_DISKLABEL_DKBAD | 62 | #define __HAVE_DISKLABEL_DKBAD | |
63 | struct dkbad bad; | 63 | struct dkbad bad; | |
64 | }; | 64 | }; | |
65 | 65 |
--- src/sys/arch/x68k/include/intr.h 2023/07/11 11:50:39 1.22
+++ src/sys/arch/x68k/include/intr.h 2024/01/07 07:58:33 1.23
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: intr.h,v 1.22 2023/07/11 11:50:39 riastradh Exp $ */ | 1 | /* $NetBSD: intr.h,v 1.23 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Minoura Makoto and Jason R. Thorpe. | 8 | * by Minoura Makoto and Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -30,29 +30,29 @@ | @@ -30,29 +30,29 @@ | |||
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #ifndef _X68K_INTR_H_ | 32 | #ifndef _X68K_INTR_H_ | |
33 | #define _X68K_INTR_H_ | 33 | #define _X68K_INTR_H_ | |
34 | 34 | |||
35 | #include <machine/psl.h> | 35 | #include <machine/psl.h> | |
36 | 36 | |||
37 | #define spl0() _spl0() | 37 | #define spl0() _spl0() | |
38 | 38 | |||
39 | #define splsoftbio() splraise1() | 39 | #define splsoftbio() splraise1() | |
40 | #define splsoftclock() splraise1() | 40 | #define splsoftclock() splraise1() | |
41 | #define splsoftnet() splraise1() | 41 | #define splsoftnet() splraise1() | |
42 | #define splsoftserial() splraise1() | 42 | #define splsoftserial() splraise1() | |
43 | #define splvm() splraise5() | 43 | #define splvm() splraise5() | |
44 | #define splsched() spl7() | 44 | #define splsched() spl7() | |
45 | #define splhigh() spl7() | 45 | #define splhigh() spl7() | |
46 | 46 | |||
47 | #define splnone() spl0() | 47 | #define splnone() spl0() | |
48 | #define splzs() splraise5() /* disallow serial interrupts */ | 48 | #define splzs() splraise5() /* disallow serial interrupts */ | |
49 | 49 | |||
50 | #define IPL_NONE 0 | 50 | #define IPL_NONE 0 | |
51 | #define IPL_SOFTCLOCK 1 | 51 | #define IPL_SOFTCLOCK 1 | |
52 | #define IPL_SOFTBIO 2 | 52 | #define IPL_SOFTBIO 2 | |
53 | #define IPL_SOFTNET 3 | 53 | #define IPL_SOFTNET 3 | |
54 | #define IPL_SOFTSERIAL 4 | 54 | #define IPL_SOFTSERIAL 4 | |
55 | #define IPL_VM 5 | 55 | #define IPL_VM 5 | |
56 | #define IPL_SCHED 6 | 56 | #define IPL_SCHED 6 | |
57 | #define IPL_HIGH 7 | 57 | #define IPL_HIGH 7 | |
58 | #define NIPL 8 | 58 | #define NIPL 8 |
--- src/sys/arch/x68k/include/kbdmap.h 2005/12/11 12:19:44 1.2
+++ src/sys/arch/x68k/include/kbdmap.h 2024/01/07 07:58:33 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kbdmap.h,v 1.2 2005/12/11 12:19:44 christos Exp $ */ | 1 | /* $NetBSD: kbdmap.h,v 1.3 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | #ifndef _X68K_KBDMAP_H_ | 3 | #ifndef _X68K_KBDMAP_H_ | |
4 | #define _X68K_KBDMAP_H_ | 4 | #define _X68K_KBDMAP_H_ | |
5 | 5 | |||
6 | #define NUL 0 | 6 | #define NUL 0 | |
7 | #define SOH 1 | 7 | #define SOH 1 | |
8 | #define STX 2 | 8 | #define STX 2 | |
9 | #define ETX 3 | 9 | #define ETX 3 | |
10 | #define EOT 4 | 10 | #define EOT 4 | |
11 | #define ENQ 5 | 11 | #define ENQ 5 | |
12 | #define ACK 6 | 12 | #define ACK 6 | |
13 | #define BEL 7 | 13 | #define BEL 7 | |
14 | #define BS 8 | 14 | #define BS 8 | |
@@ -87,21 +87,21 @@ struct key { | @@ -87,21 +87,21 @@ struct key { | |||
87 | #define KBD_MODE_STRING (1<<0) /* code is index into strings[] */ | 87 | #define KBD_MODE_STRING (1<<0) /* code is index into strings[] */ | |
88 | #define KBD_MODE_DEAD (1<<1) /* acc-index in upper nibble, code = plain acc */ | 88 | #define KBD_MODE_DEAD (1<<1) /* acc-index in upper nibble, code = plain acc */ | |
89 | #define KBD_MODE_CAPS (1<<2) /* key is capsable. Only used in non-shifted maps */ | 89 | #define KBD_MODE_CAPS (1<<2) /* key is capsable. Only used in non-shifted maps */ | |
90 | #define KBD_MODE_KPAD (1<<3) /* key is on keypad */ | 90 | #define KBD_MODE_KPAD (1<<3) /* key is on keypad */ | |
91 | #define KBD_MODE_GRAVE (KBD_ACC_GRAVE << 4) | 91 | #define KBD_MODE_GRAVE (KBD_ACC_GRAVE << 4) | |
92 | #define KBD_MODE_ACUTE (KBD_ACC_ACUTE << 4) | 92 | #define KBD_MODE_ACUTE (KBD_ACC_ACUTE << 4) | |
93 | #define KBD_MODE_CIRC (KBD_ACC_CIRC << 4) | 93 | #define KBD_MODE_CIRC (KBD_ACC_CIRC << 4) | |
94 | #define KBD_MODE_TILDE (KBD_ACC_TILDE << 4) | 94 | #define KBD_MODE_TILDE (KBD_ACC_TILDE << 4) | |
95 | #define KBD_MODE_DIER (KBD_ACC_DIER << 4) | 95 | #define KBD_MODE_DIER (KBD_ACC_DIER << 4) | |
96 | #define KBD_MODE_ACCENT(m) ((m) >> 4) /* get accent from mode */ | 96 | #define KBD_MODE_ACCENT(m) ((m) >> 4) /* get accent from mode */ | |
97 | #define KBD_MODE_ACCMASK (0xf0) | 97 | #define KBD_MODE_ACCMASK (0xf0) | |
98 | 98 | |||
99 | struct kbdmap { | 99 | struct kbdmap { | |
100 | struct key keys[KBD_NUM_KEYS], | 100 | struct key keys[KBD_NUM_KEYS], | |
101 | shift_keys[KBD_NUM_KEYS], | 101 | shift_keys[KBD_NUM_KEYS], | |
102 | alt_keys[KBD_NUM_KEYS], | 102 | alt_keys[KBD_NUM_KEYS], | |
103 | alt_shift_keys[KBD_NUM_KEYS]; | 103 | alt_shift_keys[KBD_NUM_KEYS]; | |
104 | unsigned char strings[KBD_STRTAB_SIZE]; | 104 | unsigned char strings[KBD_STRTAB_SIZE]; | |
105 | }; | 105 | }; | |
106 | 106 | |||
107 | #endif | 107 | #endif |
--- src/sys/arch/x68k/include/opmbellio.h 2005/12/11 12:19:44 1.5
+++ src/sys/arch/x68k/include/opmbellio.h 2024/01/07 07:58:33 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: opmbellio.h,v 1.5 2005/12/11 12:19:44 christos Exp $ */ | 1 | /* $NetBSD: opmbellio.h,v 1.6 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1995 Takuya Harakawa. | 4 | * Copyright (c) 1995 Takuya Harakawa. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -48,44 +48,44 @@ | @@ -48,44 +48,44 @@ | |||
48 | * | 48 | * | |
49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
59 | * SUCH DAMAGE. | 59 | * SUCH DAMAGE. | |
60 | * | 60 | * | |
61 | * $NetBSD: opmbellio.h,v 1.5 2005/12/11 12:19:44 christos Exp $ | 61 | * $NetBSD: opmbellio.h,v 1.6 2024/01/07 07:58:33 isaki Exp $ | |
62 | */ | 62 | */ | |
63 | 63 | |||
64 | #ifndef _X68K_OPMBELLIO_H_ | 64 | #ifndef _X68K_OPMBELLIO_H_ | |
65 | #define _X68K_OPMBELLIO_H_ | 65 | #define _X68K_OPMBELLIO_H_ | |
66 | #ifndef _IOCTL_ | 66 | #ifndef _IOCTL_ | |
67 | #include <sys/ioctl.h> | 67 | #include <sys/ioctl.h> | |
68 | #endif | 68 | #endif | |
69 | #include <machine/opmreg.h> | 69 | #include <machine/opmreg.h> | |
70 | 70 | |||
71 | struct bell_info { | 71 | struct bell_info { | |
72 | int volume; | 72 | int volume; | |
73 | int pitch; | 73 | int pitch; | |
74 | int msec; | 74 | int msec; | |
75 | }; | 75 | }; | |
76 | 76 | |||
77 | /* default values */ | 77 | /* default values */ | |
78 | #define BELL_VOLUME 100 /* percentage */ | 78 | #define BELL_VOLUME 100 /* percentage */ | |
79 | #define BELL_PITCH 440 | 79 | #define BELL_PITCH 440 | |
80 | #define BELL_DURATION 100 | 80 | #define BELL_DURATION 100 | |
81 | #define BELL_CHANNEL 7 | 81 | #define BELL_CHANNEL 7 | |
82 | 82 | |||
83 | /* Initial Voice Parameter; struct opm_voice */ | 83 | /* Initial Voice Parameter; struct opm_voice */ | |
84 | #define DEFAULT_BELL_VOICE { \ | 84 | #define DEFAULT_BELL_VOICE { \ | |
85 | /* AR DR SR RR SL OL KS ML DT1 DT2 AME */ \ | 85 | /* AR DR SR RR SL OL KS ML DT1 DT2 AME */ \ | |
86 | { 31, 0, 0, 0, 0, 39, 1, 1, 0, 0, 0, }, \ | 86 | { 31, 0, 0, 0, 0, 39, 1, 1, 0, 0, 0, }, \ | |
87 | { 19, 11, 0, 11, 4, 37, 0, 2, 0, 0, 0, }, \ | 87 | { 19, 11, 0, 11, 4, 37, 0, 2, 0, 0, 0, }, \ | |
88 | { 31, 15, 0, 9, 0, 55, 1, 4, 0, 0, 0, }, \ | 88 | { 31, 15, 0, 9, 0, 55, 1, 4, 0, 0, 0, }, \ | |
89 | { 19, 15, 0, 9, 0, 0, 1, 1, 0, 0, 0, }, \ | 89 | { 19, 15, 0, 9, 0, 0, 1, 1, 0, 0, 0, }, \ | |
90 | /* CON FL OP */ \ | 90 | /* CON FL OP */ \ | |
91 | 3, 7, 15 \ | 91 | 3, 7, 15 \ |
--- src/sys/arch/x68k/stand/aout2hux/aout2hux.c 2011/02/21 02:31:58 1.13
+++ src/sys/arch/x68k/stand/aout2hux/aout2hux.c 2024/01/07 07:58:33 1.14
@@ -11,27 +11,27 @@ | @@ -11,27 +11,27 @@ | |||
11 | * aout2hux [ -o output.x ] a.out1 loadaddr1 a.out2 loadaddr2 | 11 | * aout2hux [ -o output.x ] a.out1 loadaddr1 a.out2 loadaddr2 | |
12 | * | 12 | * | |
13 | * The input files must be static OMAGIC/NMAGIC m68k a.out executables | 13 | * The input files must be static OMAGIC/NMAGIC m68k a.out executables | |
14 | * or m68k ELF executables. | 14 | * or m68k ELF executables. | |
15 | * Two executables must have different loading addresses. | 15 | * Two executables must have different loading addresses. | |
16 | * Each of the load address must be a hexadecimal number. | 16 | * Each of the load address must be a hexadecimal number. | |
17 | * Load address shall be multiple of 4 for as / ld of NetBSD/m68k. | 17 | * Load address shall be multiple of 4 for as / ld of NetBSD/m68k. | |
18 | * | 18 | * | |
19 | * example: | 19 | * example: | |
20 | * % cc -N -static -Wl,-Ttext,0 -o aout1 *.o | 20 | * % cc -N -static -Wl,-Ttext,0 -o aout1 *.o | |
21 | * % cc -N -static -Wl,-Ttext,10203040 -o aout2 *.o | 21 | * % cc -N -static -Wl,-Ttext,10203040 -o aout2 *.o | |
22 | * % aout2hux -o foo.x aout1 0 aout2 10203040 | 22 | * % aout2hux -o foo.x aout1 0 aout2 10203040 | |
23 | * | 23 | * | |
24 | * $NetBSD: aout2hux.c,v 1.13 2011/02/21 02:31:58 itohy Exp $ | 24 | * $NetBSD: aout2hux.c,v 1.14 2024/01/07 07:58:33 isaki Exp $ | |
25 | */ | 25 | */ | |
26 | 26 | |||
27 | #include <sys/types.h> | 27 | #include <sys/types.h> | |
28 | #ifndef NO_UNISTD | 28 | #ifndef NO_UNISTD | |
29 | # include <unistd.h> | 29 | # include <unistd.h> | |
30 | #endif | 30 | #endif | |
31 | #ifndef NO_STDLIB | 31 | #ifndef NO_STDLIB | |
32 | # include <stdlib.h> | 32 | # include <stdlib.h> | |
33 | #endif | 33 | #endif | |
34 | #include <stdio.h> | 34 | #include <stdio.h> | |
35 | #include <string.h> | 35 | #include <string.h> | |
36 | 36 | |||
37 | #include "type_local.h" | 37 | #include "type_local.h" | |
@@ -583,27 +583,27 @@ aout2hux(const char *fn1, const char *fn | @@ -583,27 +583,27 @@ aout2hux(const char *fn1, const char *fn | |||
583 | fprintf(stderr, "address of %s or %s may be incorrect\n", | 583 | fprintf(stderr, "address of %s or %s may be incorrect\n", | |
584 | fn1, fn2); | 584 | fn1, fn2); | |
585 | goto out; | 585 | goto out; | |
586 | } | 586 | } | |
587 | 587 | |||
588 | /* | 588 | /* | |
589 | * get information of the executables | 589 | * get information of the executables | |
590 | */ | 590 | */ | |
591 | textsize = inf1.text_size; | 591 | textsize = inf1.text_size; | |
592 | paddingsize = inf1.text_pad; | 592 | paddingsize = inf1.text_pad; | |
593 | datasize = inf1.data_size; | 593 | datasize = inf1.data_size; | |
594 | execoff = inf1.entry_addr - loadadr1; | 594 | execoff = inf1.entry_addr - loadadr1; | |
595 | 595 | |||
596 | DPRINTF(("text: %u, data: %u, pad: %u, bss: %u, exec: %u\n", | 596 | DPRINTF(("text: %u, data: %u, pad: %u, bss: %u, exec: %u\n", | |
597 | textsize, datasize, paddingsize, inf1.bss_size, execoff)); | 597 | textsize, datasize, paddingsize, inf1.bss_size, execoff)); | |
598 | 598 | |||
599 | if (textsize & 1) { | 599 | if (textsize & 1) { | |
600 | fprintf(stderr, "text size is not even\n"); | 600 | fprintf(stderr, "text size is not even\n"); | |
601 | goto out; | 601 | goto out; | |
602 | } | 602 | } | |
603 | if (datasize & 1) { | 603 | if (datasize & 1) { | |
604 | fprintf(stderr, "data size is not even\n"); | 604 | fprintf(stderr, "data size is not even\n"); | |
605 | goto out; | 605 | goto out; | |
606 | } | 606 | } | |
607 | if (execoff >= textsize && | 607 | if (execoff >= textsize && | |
608 | (execoff < textsize + paddingsize || | 608 | (execoff < textsize + paddingsize || | |
609 | execoff >= textsize + paddingsize + datasize)) { | 609 | execoff >= textsize + paddingsize + datasize)) { |
--- src/sys/arch/x68k/stand/boot/boot.c 2020/01/14 03:48:10 1.31
+++ src/sys/arch/x68k/stand/boot/boot.c 2024/01/07 07:58:33 1.32
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: boot.c,v 1.31 2020/01/14 03:48:10 isaki Exp $ */ | 1 | /* $NetBSD: boot.c,v 1.32 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 Minoura Makoto | 4 | * Copyright (c) 2001 Minoura Makoto | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -307,27 +307,27 @@ bootmenu(void) | @@ -307,27 +307,27 @@ bootmenu(void) | |||
307 | int n = 5, c; | 307 | int n = 5, c; | |
308 | 308 | |||
309 | printf("Press return to boot now, any other key for boot menu\n"); | 309 | printf("Press return to boot now, any other key for boot menu\n"); | |
310 | printf("booting %s - starting in %d seconds. ", | 310 | printf("booting %s - starting in %d seconds. ", | |
311 | default_kernel, n); | 311 | default_kernel, n); | |
312 | while (n-- > 0 && (c = awaitkey_1sec()) == 0) { | 312 | while (n-- > 0 && (c = awaitkey_1sec()) == 0) { | |
313 | printf("\r"); | 313 | printf("\r"); | |
314 | printf("booting %s - starting in %d seconds. ", | 314 | printf("booting %s - starting in %d seconds. ", | |
315 | default_kernel, n); | 315 | default_kernel, n); | |
316 | } | 316 | } | |
317 | printf("\r"); | 317 | printf("\r"); | |
318 | printf("booting %s - starting in %d seconds. ", default_kernel, 0); | 318 | printf("booting %s - starting in %d seconds. ", default_kernel, 0); | |
319 | printf("\n"); | 319 | printf("\n"); | |
320 | 320 | |||
321 | if (c == 0 || c == '\r') { | 321 | if (c == 0 || c == '\r') { | |
322 | doboot(default_kernel, 0); | 322 | doboot(default_kernel, 0); | |
323 | printf("Could not start %s; ", default_kernel); | 323 | printf("Could not start %s; ", default_kernel); | |
324 | strcat(default_kernel, ".gz"); | 324 | strcat(default_kernel, ".gz"); | |
325 | printf("trying %s.\n", default_kernel); | 325 | printf("trying %s.\n", default_kernel); | |
326 | doboot(default_kernel, 0); | 326 | doboot(default_kernel, 0); | |
327 | printf("Could not start %s; ", default_kernel); | 327 | printf("Could not start %s; ", default_kernel); | |
328 | } | 328 | } | |
329 | 329 | |||
330 | printf("Please use the absolute unit# (e.g. SCSI ID)" | 330 | printf("Please use the absolute unit# (e.g. SCSI ID)" | |
331 | " instead of the NetBSD logical #.\n"); | 331 | " instead of the NetBSD logical #.\n"); | |
332 | for (;;) { | 332 | for (;;) { | |
333 | char *p, *options; | 333 | char *p, *options; | |
@@ -368,27 +368,27 @@ checkmemsize(void) | @@ -368,27 +368,27 @@ checkmemsize(void) | |||
368 | /* no memory */ | 368 | /* no memory */ | |
369 | break; | 369 | break; | |
370 | } | 370 | } | |
371 | } | 371 | } | |
372 | 372 | |||
373 | return (m - 1) * 1024 * 1024; | 373 | return (m - 1) * 1024 * 1024; | |
374 | } | 374 | } | |
375 | 375 | |||
376 | extern const char bootprog_rev[]; | 376 | extern const char bootprog_rev[]; | |
377 | extern const char bootprog_name[]; | 377 | extern const char bootprog_name[]; | |
378 | 378 | |||
379 | /* | 379 | /* | |
380 | * Arguments from the boot block: | 380 | * Arguments from the boot block: | |
381 | * bootdev - specifies the device from which /boot was read, in | 381 | * bootdev - specifies the device from which /boot was read, in | |
382 | * bootdev format. | 382 | * bootdev format. | |
383 | */ | 383 | */ | |
384 | void | 384 | void | |
385 | bootmain(int bootdev) | 385 | bootmain(int bootdev) | |
386 | { | 386 | { | |
387 | u_int sram_memsize; | 387 | u_int sram_memsize; | |
388 | u_int probed_memsize; | 388 | u_int probed_memsize; | |
389 | 389 | |||
390 | console_device = consio_init(console_device); | 390 | console_device = consio_init(console_device); | |
391 | 391 | |||
392 | hostadaptor = get_scsi_host_adapter(); | 392 | hostadaptor = get_scsi_host_adapter(); | |
393 | rtc_offset = RTC_OFFSET; | 393 | rtc_offset = RTC_OFFSET; | |
394 | try_bootp = 1; | 394 | try_bootp = 1; |
--- src/sys/arch/x68k/stand/boot/boot.ldscript 2020/01/18 06:03:02 1.9
+++ src/sys/arch/x68k/stand/boot/boot.ldscript 2024/01/07 07:58:33 1.10
@@ -1,17 +1,17 @@ | @@ -1,17 +1,17 @@ | |||
1 | /* /boot must be a.out, OMAGIC starting from 0x6000. */ | 1 | /* /boot must be a.out, OMAGIC starting from 0x6000. */ | |
2 | /* ... but new binutils don't support a.out anymore... | 2 | /* ... but new binutils don't support a.out anymore... | |
3 | OUTPUT_FORMAT("a.out-m68k-netbsd", "a.out-m68k-netbsd", | 3 | OUTPUT_FORMAT("a.out-m68k-netbsd", "a.out-m68k-netbsd", | |
4 | "a.out-m68k-netbsd") | 4 | "a.out-m68k-netbsd") | |
5 | */ | 5 | */ | |
6 | OUTPUT_ARCH(m68k) | 6 | OUTPUT_ARCH(m68k) | |
7 | ENTRY(start) | 7 | ENTRY(start) | |
8 | SEARCH_DIR(/usr/lib); | 8 | SEARCH_DIR(/usr/lib); | |
9 | /*__DYNAMIC = 0; */ | 9 | /*__DYNAMIC = 0; */ | |
10 | PROVIDE (__stack = 0); | 10 | PROVIDE (__stack = 0); | |
11 | SECTIONS | 11 | SECTIONS | |
12 | { | 12 | { | |
13 | . = TEXTADDR; | 13 | . = TEXTADDR; | |
14 | .text : | 14 | .text : | |
15 | { | 15 | { | |
16 | CREATE_OBJECT_SYMBOLS | 16 | CREATE_OBJECT_SYMBOLS | |
17 | *(.text) | 17 | *(.text) |
--- src/sys/arch/x68k/stand/boot/if_ne.c 2012/11/01 14:46:26 1.2
+++ src/sys/arch/x68k/stand/boot/if_ne.c 2024/01/07 07:58:33 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_ne.c,v 1.2 2012/11/01 14:46:26 isaki Exp $ */ | 1 | /* $NetBSD: if_ne.c,v 1.3 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Tetsuya Isaki. All rights reserved. | 4 | * Copyright (c) 2003 Tetsuya Isaki. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
@@ -104,34 +104,34 @@ ne_get(struct iodesc *desc, void *pkt, s | @@ -104,34 +104,34 @@ ne_get(struct iodesc *desc, void *pkt, s | |||
104 | while (getsecs() < t) { | 104 | while (getsecs() < t) { | |
105 | len = EtherReceive(pkt, maxlen); | 105 | len = EtherReceive(pkt, maxlen); | |
106 | if (len) | 106 | if (len) | |
107 | break; | 107 | break; | |
108 | } | 108 | } | |
109 | 109 | |||
110 | return len; | 110 | return len; | |
111 | } | 111 | } | |
112 | 112 | |||
113 | static int | 113 | static int | |
114 | ne_put(struct iodesc *desc, void *pkt, size_t len) | 114 | ne_put(struct iodesc *desc, void *pkt, size_t len) | |
115 | { | 115 | { | |
116 | #ifdef DEBUG | 116 | #ifdef DEBUG | |
117 | struct ether_header *eh; | 117 | struct ether_header *eh; | |
118 | 118 | |||
119 | eh = pkt; | 119 | eh = pkt; | |
120 | printf("dst: %s\n", ether_sprintf(eh->ether_dhost)); | 120 | printf("dst: %s\n", ether_sprintf(eh->ether_dhost)); | |
121 | printf("src: %s\n", ether_sprintf(eh->ether_shost)); | 121 | printf("src: %s\n", ether_sprintf(eh->ether_shost)); | |
122 | printf("type: 0x%x\n", eh->ether_type & 0xffff); | 122 | printf("type: 0x%x\n", eh->ether_type & 0xffff); | |
123 | #endif | 123 | #endif | |
124 | 124 | |||
125 | return EtherSend(pkt, len); | 125 | return EtherSend(pkt, len); | |
126 | } | 126 | } | |
127 | 127 | |||
128 | static void | 128 | static void | |
129 | ne_end(struct netif *nif) | 129 | ne_end(struct netif *nif) | |
130 | { | 130 | { | |
131 | 131 | |||
132 | #ifdef DEBUG | 132 | #ifdef DEBUG | |
133 | printf("ne_end\n"); | 133 | printf("ne_end\n"); | |
134 | #endif | 134 | #endif | |
135 | 135 | |||
136 | EtherStop(); | 136 | EtherStop(); | |
137 | } | 137 | } |
--- src/sys/arch/x68k/stand/boot/srt0.S 2011/04/12 14:07:35 1.2
+++ src/sys/arch/x68k/stand/boot/srt0.S 2024/01/07 07:58:33 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: srt0.S,v 1.2 2011/04/12 14:07:35 tsutsui Exp $ */ | 1 | /* $NetBSD: srt0.S,v 1.3 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2001 Minoura Makoto | 4 | * Copyright (c) 2001 Minoura Makoto | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -16,27 +16,27 @@ | @@ -16,27 +16,27 @@ | |||
16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 | * SUCH DAMAGE. | 26 | * SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <m68k/asm.h> | 29 | #include <m68k/asm.h> | |
30 | 30 | |||
31 | ASENTRY(start) | 31 | ASENTRY(start) | |
32 | bra start0 | 32 | bra start0 | |
33 | .ascii BOOT | 33 | .ascii BOOT | |
34 | .byte 0x20 | 34 | .byte 0x20 | |
35 | .asciz BOOT_VERS | 35 | .asciz BOOT_VERS | |
36 | .even | 36 | .even | |
37 | 37 | |||
38 | /* | 38 | /* | |
39 | * via stack: (firstpa, physsize, esym) | 39 | * via stack: (firstpa, physsize, esym) | |
40 | * via regs: %d6: bootdev | 40 | * via regs: %d6: bootdev | |
41 | * %d7: boothowto | 41 | * %d7: boothowto | |
42 | * for /boot, only %d6 is used. | 42 | * for /boot, only %d6 is used. |
--- src/sys/arch/x68k/stand/boot_ufs/readufs_lfs.c 2015/08/21 15:33:04 1.17
+++ src/sys/arch/x68k/stand/boot_ufs/readufs_lfs.c 2024/01/07 07:58:33 1.18
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: readufs_lfs.c,v 1.17 2015/08/21 15:33:04 christos Exp $ */ | 1 | /* $NetBSD: readufs_lfs.c,v 1.18 2024/01/07 07:58:33 isaki Exp $ */ | |
2 | /* from Id: readufs_lfs.c,v 1.7 2003/10/15 14:16:58 itohy Exp */ | 2 | /* from Id: readufs_lfs.c,v 1.7 2003/10/15 14:16:58 itohy Exp */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * FS specific support for 4.4BSD Log-structured Filesystem | 5 | * FS specific support for 4.4BSD Log-structured Filesystem | |
6 | * | 6 | * | |
7 | * Written in 1999, 2002, 2003 by ITOH Yasufumi. | 7 | * Written in 1999, 2002, 2003 by ITOH Yasufumi. | |
8 | * Public domain. | 8 | * Public domain. | |
9 | * | 9 | * | |
10 | * Intended to be used for boot programs (first stage). | 10 | * Intended to be used for boot programs (first stage). | |
11 | * DON'T ADD ANY FANCY FEATURE. THIS SHALL BE COMPACT. | 11 | * DON'T ADD ANY FANCY FEATURE. THIS SHALL BE COMPACT. | |
12 | */ | 12 | */ | |
13 | 13 | |||
14 | #include "readufs.h" | 14 | #include "readufs.h" | |
@@ -160,27 +160,27 @@ get_lfs_inode(ino32_t ino, union ufs_din | @@ -160,27 +160,27 @@ get_lfs_inode(ino32_t ino, union ufs_din | |||
160 | daddr_t daddr; | 160 | daddr_t daddr; | |
161 | char *buf = alloca(fsi.bsize); | 161 | char *buf = alloca(fsi.bsize); | |
162 | struct lfs32_dinode *di, *diend; | 162 | struct lfs32_dinode *di, *diend; | |
163 | int i; | 163 | int i; | |
164 | 164 | |||
165 | /* Get fs block which contains the specified inode. */ | 165 | /* Get fs block which contains the specified inode. */ | |
166 | if (ino == LFS_IFILE_INUM) | 166 | if (ino == LFS_IFILE_INUM) | |
167 | daddr = fsi_lfs.idaddr; | 167 | daddr = fsi_lfs.idaddr; | |
168 | else { | 168 | else { | |
169 | #ifdef DEBUG_WITH_STDIO | 169 | #ifdef DEBUG_WITH_STDIO | |
170 | printf("LFS: ino: %d\nifpb: %d, bsize: %d\n", | 170 | printf("LFS: ino: %d\nifpb: %d, bsize: %d\n", | |
171 | ino, fsi_lfs.ifpb, fsi.bsize); | 171 | ino, fsi_lfs.ifpb, fsi.bsize); | |
172 | #endif | 172 | #endif | |
173 | ufs_read((union ufs_dinode *) &ifile_dinode, buf, | 173 | ufs_read((union ufs_dinode *) &ifile_dinode, buf, | |
174 | ino / fsi_lfs.ifpb + fsi_lfs.ioffset, | 174 | ino / fsi_lfs.ifpb + fsi_lfs.ioffset, | |
175 | fsi.bsize); | 175 | fsi.bsize); | |
176 | i = ino % fsi_lfs.ifpb; | 176 | i = ino % fsi_lfs.ifpb; | |
177 | daddr = (fsi_lfs.version == 1) ? | 177 | daddr = (fsi_lfs.version == 1) ? | |
178 | ((IFILE_V1 *) buf + i)->if_daddr | 178 | ((IFILE_V1 *) buf + i)->if_daddr | |
179 | : ((IFILE32 *) buf + i)->if_daddr; | 179 | : ((IFILE32 *) buf + i)->if_daddr; | |
180 | } | 180 | } | |
181 | #ifdef DEBUG_WITH_STDIO | 181 | #ifdef DEBUG_WITH_STDIO | |
182 | printf("LFS(%d): daddr: %d\n", ino, (int) daddr); | 182 | printf("LFS(%d): daddr: %d\n", ino, (int) daddr); | |
183 | #endif | 183 | #endif | |
184 | 184 | |||
185 | if (daddr == LFS_UNUSED_DADDR) | 185 | if (daddr == LFS_UNUSED_DADDR) | |
186 | return 1; | 186 | return 1; |
--- src/sys/arch/x68k/stand/common/exec_image.S 2001/09/27 14:08:28 1.2
+++ src/sys/arch/x68k/stand/common/exec_image.S 2024/01/07 07:58:34 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: exec_image.S,v 1.2 2001/09/27 14:08:28 minoura Exp $ */ | 1 | /* $NetBSD: exec_image.S,v 1.3 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 Minoura Makoto. | 4 | * Copyright (c) 2001 Minoura Makoto. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | */ | 26 | */ | |
27 | 27 | |||
28 | #include <machine/asm.h> | 28 | #include <machine/asm.h> | |
29 | 29 | |||
30 | #ifndef LASTADDR | 30 | #ifndef LASTADDR | |
31 | #define LASTADDR (0x00ed0008) | 31 | #define LASTADDR (0x00ed0008) | |
32 | #endif | 32 | #endif | |
33 | 33 | |||
34 | .text | 34 | .text | |
35 | .even | 35 | .even | |
36 | 36 | |||
37 | ENTRY_NOPROFILE(exec_image) | 37 | ENTRY_NOPROFILE(exec_image) | |
38 | || void exec_image(loaded,executed,entry,size,bootdev,boothowto) | 38 | || void exec_image(loaded,executed,entry,size,bootdev,boothowto) | |
39 | || unsigned int loaded; | 39 | || unsigned int loaded; | |
40 | || unsigned int executed; | 40 | || unsigned int executed; | |
41 | || unsigned int entry; | 41 | || unsigned int entry; | |
42 | || int size; | 42 | || int size; | |
43 | || int bootdev; | 43 | || int bootdev; | |
44 | || int boothowto; | 44 | || int boothowto; | |
45 | addl #4,%sp | throw away the return address | 45 | addl #4,%sp | throw away the return address | |
46 | moveml %sp@+,%a4-%a6 | 46 | moveml %sp@+,%a4-%a6 | |
47 | moveml %sp@+,%d5-%d7 | 47 | moveml %sp@+,%d5-%d7 | |
48 | 48 | |||
49 | /* copy the trampoline to the last physical page. */ | 49 | /* copy the trampoline to the last physical page. */ | |
50 | moval LASTADDR,%sp | tmpstack from end of physmem | 50 | moval LASTADDR,%sp | tmpstack from end of physmem | |
51 | lea %sp@(-4096),%a3 | use last phys page as tramp | 51 | lea %sp@(-4096),%a3 | use last phys page as tramp | |
52 | 52 |
--- src/sys/arch/x68k/stand/common/start.S 2011/02/21 02:31:58 1.3
+++ src/sys/arch/x68k/stand/common/start.S 2024/01/07 07:58:34 1.4
@@ -1,25 +1,25 @@ | @@ -1,25 +1,25 @@ | |||
1 | |----------------------------------------------------------- | 1 | |----------------------------------------------------------- | |
2 | | | 2 | | | |
3 | | Simple C runtime startup for Human68k | 3 | | Simple C runtime startup for Human68k | |
4 | | | 4 | | | |
5 | | o no stdio support (DOS/IOCS only) | 5 | | o no stdio support (DOS/IOCS only) | |
6 | | o HUPAIR support | 6 | | o HUPAIR support | |
7 | | | 7 | | | |
8 | | written by ITOH Yasufumi | 8 | | written by ITOH Yasufumi | |
9 | | | 9 | | | |
10 | | This file is in the public domain | 10 | | This file is in the public domain | |
11 | | | 11 | | | |
12 | | $NetBSD: start.S,v 1.3 2011/02/21 02:31:58 itohy Exp $ | 12 | | $NetBSD: start.S,v 1.4 2024/01/07 07:58:34 isaki Exp $ | |
13 | 13 | |||
14 | #include <machine/asm.h> | 14 | #include <machine/asm.h> | |
15 | 15 | |||
16 | |----------------------------------------------------------- | 16 | |----------------------------------------------------------- | |
17 | | | 17 | | | |
18 | | configuration | 18 | | configuration | |
19 | | | 19 | | | |
20 | #ifndef STACK_SIZE | 20 | #ifndef STACK_SIZE | |
21 | #define STACK_SIZE 65536 /* stack size in bytes */ | 21 | #define STACK_SIZE 65536 /* stack size in bytes */ | |
22 | #endif | 22 | #endif | |
23 | 23 | |||
24 | #ifndef STACK_SYMBOL | 24 | #ifndef STACK_SYMBOL | |
25 | #ifdef __ELF__ | 25 | #ifdef __ELF__ | |
@@ -74,30 +74,30 @@ | @@ -74,30 +74,30 @@ | |||
74 | #endif | 74 | #endif | |
75 | 75 | |||
76 | |----------------------------------------------------------- | 76 | |----------------------------------------------------------- | |
77 | | | 77 | | | |
78 | | DOS call | 78 | | DOS call | |
79 | | | 79 | | | |
80 | #define DOS(x) .word x | 80 | #define DOS(x) .word x | |
81 | 81 | |||
82 | #define __FPUTS 0xFF1E | 82 | #define __FPUTS 0xFF1E | |
83 | #define __VERNUM 0xFF30 | 83 | #define __VERNUM 0xFF30 | |
84 | #define __SETBLOCK 0xFF4A | 84 | #define __SETBLOCK 0xFF4A | |
85 | #define __EXIT2 0xFF4C | 85 | #define __EXIT2 0xFF4C | |
86 | 86 | |||
87 | | | 87 | | | |
88 | | seed to estimate argument string/vector and environment vector size | 88 | | seed to estimate argument string/vector and environment vector size | |
89 | | (max nohupair argv[0](92+4) + NULLs(8) + alignment(3)) <- donburi? | 89 | | (max nohupair argv[0](92+4) + NULLs(8) + alignment(3)) <- donburi? | |
90 | | | 90 | | | |
91 | #define estimated_argsz 107 | 91 | #define estimated_argsz 107 | |
92 | #define estimated_com 92 /* estimated command name length (included) */ | 92 | #define estimated_com 92 /* estimated command name length (included) */ | |
93 | 93 | |||
94 | | | 94 | | | |
95 | | other constants | 95 | | other constants | |
96 | | | 96 | | | |
97 | #define char_tab 0x09 | 97 | #define char_tab 0x09 | |
98 | #define char_space 0x20 | 98 | #define char_space 0x20 | |
99 | #define char_dquote 0x22 | 99 | #define char_dquote 0x22 | |
100 | #define char_squote 0x27 | 100 | #define char_squote 0x27 | |
101 | #define char_slash 0x2f | 101 | #define char_slash 0x2f | |
102 | #define char_backslash 0x5c | 102 | #define char_backslash 0x5c | |
103 | 103 |
--- src/sys/arch/x68k/stand/libsa/clock.c 2014/11/21 01:18:39 1.5
+++ src/sys/arch/x68k/stand/libsa/clock.c 2024/01/07 07:58:34 1.6
@@ -1,40 +1,40 @@ | @@ -1,40 +1,40 @@ | |||
1 | /* $NetBSD: clock.c,v 1.5 2014/11/21 01:18:39 christos Exp $ */ | 1 | /* $NetBSD: clock.c,v 1.6 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Tetsuya Isaki. All rights reserved. | 4 | * Copyright (c) 2003 Tetsuya Isaki. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | * SUCH DAMAGE. | 25 | * SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | #include <sys/types.h> | 28 | #include <sys/types.h> | |
29 | #include <sys/clock.h> | 29 | #include <sys/clock.h> | |
30 | #include <lib/libsa/stand.h> | 30 | #include <lib/libsa/stand.h> | |
31 | #include <lib/libsa/net.h> | 31 | #include <lib/libsa/net.h> | |
32 | #include "iocs.h" | 32 | #include "iocs.h" | |
33 | #include "libx68k.h" | 33 | #include "libx68k.h" | |
34 | #include "consio.h" /* XXX: for MFP_TIMERC */ | 34 | #include "consio.h" /* XXX: for MFP_TIMERC */ | |
35 | 35 | |||
36 | /* x68k's RTC is defunct 2079, so there is no y2100 problem. */ | 36 | /* x68k's RTC is defunct 2079, so there is no y2100 problem. */ | |
37 | 37 | |||
38 | int rtc_offset; | 38 | int rtc_offset; | |
39 | 39 | |||
40 | const int yday[] = { | 40 | const int yday[] = { |
--- src/sys/arch/x68k/stand/libsa/consio.c 2014/10/17 17:48:53 1.11
+++ src/sys/arch/x68k/stand/libsa/consio.c 2024/01/07 07:58:34 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: consio.c,v 1.11 2014/10/17 17:48:53 snj Exp $ */ | 1 | /* $NetBSD: consio.c,v 1.12 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 MINOURA Makoto. | 4 | * Copyright (c) 2001 MINOURA Makoto. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -105,27 +105,27 @@ check_getchar(void) | @@ -105,27 +105,27 @@ check_getchar(void) | |||
105 | { | 105 | { | |
106 | int keycode; | 106 | int keycode; | |
107 | 107 | |||
108 | switch (x68k_console_device) { | 108 | switch (x68k_console_device) { | |
109 | case ITE: | 109 | case ITE: | |
110 | while ((keycode = IOCS_B_KEYSNS()) != 0) { | 110 | while ((keycode = IOCS_B_KEYSNS()) != 0) { | |
111 | keycode &= 0xff; | 111 | keycode &= 0xff; | |
112 | if (keycode != 0) { | 112 | if (keycode != 0) { | |
113 | /* valid ASCII code */ | 113 | /* valid ASCII code */ | |
114 | return keycode; | 114 | return keycode; | |
115 | } | 115 | } | |
116 | /* discard non ASCII keys (CTRL, OPT.1 etc) */ | 116 | /* discard non ASCII keys (CTRL, OPT.1 etc) */ | |
117 | (void)IOCS_B_KEYINP(); | 117 | (void)IOCS_B_KEYINP(); | |
118 | } | 118 | } | |
119 | /* no input */ | 119 | /* no input */ | |
120 | return 0; | 120 | return 0; | |
121 | case SERIAL: | 121 | case SERIAL: | |
122 | return IOCS_ISNS232C() & 0xff; | 122 | return IOCS_ISNS232C() & 0xff; | |
123 | } | 123 | } | |
124 | 124 | |||
125 | return -1; | 125 | return -1; | |
126 | } | 126 | } | |
127 | 127 | |||
128 | int | 128 | int | |
129 | awaitkey_1sec(void) | 129 | awaitkey_1sec(void) | |
130 | { | 130 | { | |
131 | int i, c; | 131 | int i, c; |
--- src/sys/arch/x68k/stand/libsa/fd.c 2014/03/08 03:20:24 1.8
+++ src/sys/arch/x68k/stand/libsa/fd.c 2024/01/07 07:58:34 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fd.c,v 1.8 2014/03/08 03:20:24 isaki Exp $ */ | 1 | /* $NetBSD: fd.c,v 1.9 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 MINOURA Makoto. | 4 | * Copyright (c) 2001 MINOURA Makoto. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -98,27 +98,27 @@ fdstrategy(void *arg, int rw, daddr_t db | @@ -98,27 +98,27 @@ fdstrategy(void *arg, int rw, daddr_t db | |||
98 | int error, nbytes; | 98 | int error, nbytes; | |
99 | 99 | |||
100 | if (size == 0) { | 100 | if (size == 0) { | |
101 | if (rsize) | 101 | if (rsize) | |
102 | *rsize = 0; | 102 | *rsize = 0; | |
103 | return 0; | 103 | return 0; | |
104 | } | 104 | } | |
105 | nbytes = howmany(size, 128 << sc->fmt.minsec.N) | 105 | nbytes = howmany(size, 128 << sc->fmt.minsec.N) | |
106 | * (128 << sc->fmt.minsec.N); | 106 | * (128 << sc->fmt.minsec.N); | |
107 | 107 | |||
108 | nhead = sc->fmt.maxsec.H - sc->fmt.minsec.H + 1; | 108 | nhead = sc->fmt.maxsec.H - sc->fmt.minsec.H + 1; | |
109 | nsect = sc->fmt.maxsec.R - sc->fmt.minsec.R + 1; | 109 | nsect = sc->fmt.maxsec.R - sc->fmt.minsec.R + 1; | |
110 | 110 | |||
111 | sect = dblk % nsect + sc->fmt.minsec.R; | 111 | sect = dblk % nsect + sc->fmt.minsec.R; | |
112 | head = (dblk / nsect) % nhead + sc->fmt.minsec.H; | 112 | head = (dblk / nsect) % nhead + sc->fmt.minsec.H; | |
113 | cyl = (dblk / nsect) / nhead + sc->fmt.minsec.C; | 113 | cyl = (dblk / nsect) / nhead + sc->fmt.minsec.C; | |
114 | 114 | |||
115 | error = IOCS_B_READ((sc->unit + 0x90) * 256 + 0x70, | 115 | error = IOCS_B_READ((sc->unit + 0x90) * 256 + 0x70, | |
116 | ((sc->fmt.minsec.N << 24) | | 116 | ((sc->fmt.minsec.N << 24) | | |
117 | (cyl << 16) | | 117 | (cyl << 16) | | |
118 | (head << 8) | | 118 | (head << 8) | | |
119 | (sect)), | 119 | (sect)), | |
120 | nbytes, | 120 | nbytes, | |
121 | buf); | 121 | buf); | |
122 | if (error & 0xf8ffff00) { | 122 | if (error & 0xf8ffff00) { | |
123 | nbytes = 0; | 123 | nbytes = 0; | |
124 | error = EIO; | 124 | error = EIO; |
--- src/sys/arch/x68k/stand/libsa/fdsub.S 2001/09/27 10:03:28 1.1
+++ src/sys/arch/x68k/stand/libsa/fdsub.S 2024/01/07 07:58:34 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fdsub.S,v 1.1 2001/09/27 10:03:28 minoura Exp $ */ | 1 | /* $NetBSD: fdsub.S,v 1.2 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 MINOURA Makoto. | 4 | * Copyright (c) 2001 MINOURA Makoto. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -23,27 +23,27 @@ | @@ -23,27 +23,27 @@ | |||
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | #include <machine/asm.h> | 28 | #include <machine/asm.h> | |
29 | #include "iocscall.h" | 29 | #include "iocscall.h" | |
30 | 30 | |||
31 | /* | 31 | /* | |
32 | * int fd_check_fmt(drive, head, minmax) | 32 | * int fd_check_fmt(drive, head, minmax) | |
33 | * int drive; (0-3) | 33 | * int drive; (0-3) | |
34 | * int head; (0-1) | 34 | * int head; (0-1) | |
35 | * struct fdfmt *minmax; (results are stored) | 35 | * struct fdfmt *minmax; (results are stored) | |
36 | * return value: 0 on success, or negative | 36 | * return value: 0 on success, or negative | |
37 | */ | 37 | */ | |
38 | 38 | |||
39 | .text | 39 | .text | |
40 | ENTRY_NOPROFILE(fd_check_format) | 40 | ENTRY_NOPROFILE(fd_check_format) | |
41 | || movl %sp@(4),%d1 | 41 | || movl %sp@(4),%d1 | |
42 | || andil #3,%d1 | 42 | || andil #3,%d1 | |
43 | || orib #0x90,%d1 | 43 | || orib #0x90,%d1 | |
44 | || lslw #8,%d1 | 44 | || lslw #8,%d1 | |
45 | || movql #0,%d2 | 45 | || movql #0,%d2 | |
46 | || IOCS(__B_DRVCHK) | 46 | || IOCS(__B_DRVCHK) | |
47 | || btst.b #1,%d0 | 47 | || btst.b #1,%d0 | |
48 | || beq fail | 48 | || beq fail | |
49 | || IOCS(__B_RECALI) | 49 | || IOCS(__B_RECALI) |
--- src/sys/arch/x68k/stand/libsa/parseutils.c 2016/05/31 04:12:10 1.3
+++ src/sys/arch/x68k/stand/libsa/parseutils.c 2024/01/07 07:58:34 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: parseutils.c,v 1.3 2016/05/31 04:12:10 dholland Exp $ */ | 1 | /* $NetBSD: parseutils.c,v 1.4 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * from /sys/arch/i386/lib/parseutils.c | 4 | * from /sys/arch/i386/lib/parseutils.c | |
5 | * NetBSD: parseutils.c,v 1.3 2000/09/24 12:32:35 jdolecek Exp | 5 | * NetBSD: parseutils.c,v 1.3 2000/09/24 12:32:35 jdolecek Exp | |
6 | */ | 6 | */ | |
7 | 7 | |||
8 | /* | 8 | /* | |
9 | * Copyright (c) 1996, 1997 | 9 | * Copyright (c) 1996, 1997 | |
10 | * Matthias Drochner. All rights reserved. | 10 | * Matthias Drochner. All rights reserved. | |
11 | * Copyright (c) 1996, 1997 | 11 | * Copyright (c) 1996, 1997 | |
12 | * Perry E. Metzger. All rights reserved. | 12 | * Perry E. Metzger. All rights reserved. | |
13 | * Copyright (c) 1997 | 13 | * Copyright (c) 1997 | |
14 | * Jason R. Thorpe. All rights reserved | 14 | * Jason R. Thorpe. All rights reserved | |
@@ -65,27 +65,27 @@ gettrailer(char *arg) | @@ -65,27 +65,27 @@ gettrailer(char *arg) | |||
65 | 65 | |||
66 | /* trim leading blanks */ | 66 | /* trim leading blanks */ | |
67 | while (*options == ' ') | 67 | while (*options == ' ') | |
68 | options++; | 68 | options++; | |
69 | 69 | |||
70 | return options; | 70 | return options; | |
71 | } | 71 | } | |
72 | 72 | |||
73 | int | 73 | int | |
74 | parseopts(const char *opts, int *howto) | 74 | parseopts(const char *opts, int *howto) | |
75 | { | 75 | { | |
76 | int r, tmpopt = 0; | 76 | int r, tmpopt = 0; | |
77 | 77 | |||
78 | opts++; /* skip - */ | 78 | opts++; /* skip - */ | |
79 | while (*opts && *opts != ' ') { | 79 | while (*opts && *opts != ' ') { | |
80 | r = 0; | 80 | r = 0; | |
81 | BOOT_FLAG(*opts, r); | 81 | BOOT_FLAG(*opts, r); | |
82 | if (r == 0) { | 82 | if (r == 0) { | |
83 | printf("-%c: unknown flag\n", *opts); | 83 | printf("-%c: unknown flag\n", *opts); | |
84 | return 0; | 84 | return 0; | |
85 | } | 85 | } | |
86 | tmpopt |= r; | 86 | tmpopt |= r; | |
87 | opts++; | 87 | opts++; | |
88 | } | 88 | } | |
89 | 89 | |||
90 | *howto = tmpopt; | 90 | *howto = tmpopt; | |
91 | return 1; | 91 | return 1; |
--- src/sys/arch/x68k/stand/libsa/sdcd.c 2022/06/23 12:32:22 1.18
+++ src/sys/arch/x68k/stand/libsa/sdcd.c 2024/01/07 07:58:34 1.19
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: sdcd.c,v 1.18 2022/06/23 12:32:22 isaki Exp $ */ | 1 | /* $NetBSD: sdcd.c,v 1.19 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 MINOURA Makoto. | 4 | * Copyright (c) 2001 MINOURA Makoto. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -41,27 +41,27 @@ static int current_blkbytes; | @@ -41,27 +41,27 @@ static int current_blkbytes; | |||
41 | static int current_blkshift; | 41 | static int current_blkshift; | |
42 | static int current_devsize, current_npart; | 42 | static int current_devsize, current_npart; | |
43 | static struct boot_partinfo partitions[MAXPARTITIONS]; | 43 | static struct boot_partinfo partitions[MAXPARTITIONS]; | |
44 | 44 | |||
45 | static uint human2blk(uint); | 45 | static uint human2blk(uint); | |
46 | static uint human2bsd(uint); | 46 | static uint human2bsd(uint); | |
47 | static uint bsd2blk(uint); | 47 | static uint bsd2blk(uint); | |
48 | static int readdisklabel(int); | 48 | static int readdisklabel(int); | |
49 | static int check_unit(int); | 49 | static int check_unit(int); | |
50 | 50 | |||
51 | #ifdef DEBUG | 51 | #ifdef DEBUG | |
52 | #define DPRINTF(x) printf x | 52 | #define DPRINTF(x) printf x | |
53 | #else | 53 | #else | |
54 | #define DPRINTF(x) | 54 | #define DPRINTF(x) | |
55 | #endif | 55 | #endif | |
56 | 56 | |||
57 | /* | 57 | /* | |
58 | * Convert the number of sectors on Human68k | 58 | * Convert the number of sectors on Human68k | |
59 | * into the number of blocks on the current device. | 59 | * into the number of blocks on the current device. | |
60 | */ | 60 | */ | |
61 | static uint | 61 | static uint | |
62 | human2blk(uint n) | 62 | human2blk(uint n) | |
63 | { | 63 | { | |
64 | uint blk_per_sect; | 64 | uint blk_per_sect; | |
65 | 65 | |||
66 | /* Human68k uses 1024 byte/sector. */ | 66 | /* Human68k uses 1024 byte/sector. */ | |
67 | blk_per_sect = 4 >> current_blkshift; | 67 | blk_per_sect = 4 >> current_blkshift; |
--- src/sys/arch/x68k/stand/loadbsd/Makefile 2019/09/23 13:42:37 1.19
+++ src/sys/arch/x68k/stand/loadbsd/Makefile 2024/01/07 07:58:34 1.20
@@ -1,40 +1,40 @@ | @@ -1,40 +1,40 @@ | |||
1 | # $NetBSD: Makefile,v 1.19 2019/09/23 13:42:37 christos Exp $ | 1 | # $NetBSD: Makefile,v 1.20 2024/01/07 07:58:34 isaki Exp $ | |
2 | 2 | |||
3 | S= ${.CURDIR}/../../../.. | 3 | S= ${.CURDIR}/../../../.. | |
4 | 4 | |||
5 | BASE= loadbsd | 5 | BASE= loadbsd | |
6 | PROG= ${BASE}.x # Human68k ".x" executable | 6 | PROG= ${BASE}.x # Human68k ".x" executable | |
7 | BINMODE=444 # not to be run on NetBSD | 7 | BINMODE=444 # not to be run on NetBSD | |
8 | SRCS= start.S loadbsd.c xprintf.c trampoline.S | 8 | SRCS= start.S loadbsd.c xprintf.c trampoline.S | |
9 | 9 | |||
10 | NOMAN= # defined | 10 | NOMAN= # defined | |
11 | BINDIR= /usr/mdec | 11 | BINDIR= /usr/mdec | |
12 | 12 | |||
13 | .PATH: ${.CURDIR}/../common | 13 | .PATH: ${.CURDIR}/../common | |
14 | 14 | |||
15 | .include <bsd.own.mk> | 15 | .include <bsd.own.mk> | |
16 | .include <bsd.klinks.mk> | 16 | .include <bsd.klinks.mk> | |
17 | 17 | |||
18 | STRIPFLAG= # not an elf | 18 | STRIPFLAG= # not an elf | |
19 | 19 | |||
20 | AOUT2HUXDIR!= cd ${.CURDIR}/../aout2hux && ${PRINTOBJDIR} | 20 | AOUT2HUXDIR!= cd ${.CURDIR}/../aout2hux && ${PRINTOBJDIR} | |
21 | AOUT2HUX= ${AOUT2HUXDIR}/aout2hux | 21 | AOUT2HUX= ${AOUT2HUXDIR}/aout2hux | |
22 | LIBDOS!= cd ${.CURDIR}/../libdos && ${PRINTOBJDIR} | 22 | LIBDOS!= cd ${.CURDIR}/../libdos && ${PRINTOBJDIR} | |
23 | LIBIOCS!= cd ${.CURDIR}/../libiocs && ${PRINTOBJDIR} | 23 | LIBIOCS!= cd ${.CURDIR}/../libiocs && ${PRINTOBJDIR} | |
24 | 24 | |||
25 | CPPFLAGS= -W -Wall -O -fomit-frame-pointer -fno-unwind-tables | 25 | CPPFLAGS= -W -Wall -O -fomit-frame-pointer -fno-unwind-tables | |
26 | CPPFLAGS+= -m68000 -Wa,-mc68000 | 26 | CPPFLAGS+= -m68000 -Wa,-mc68000 | |
27 | CPPFLAGS+= -nostdinc | 27 | CPPFLAGS+= -nostdinc | |
28 | CPPFLAGS+= -I$S -I. | 28 | CPPFLAGS+= -I$S -I. | |
29 | CPPFLAGS+= -I${.CURDIR}/../libdos -I${.CURDIR}/../libiocs | 29 | CPPFLAGS+= -I${.CURDIR}/../libdos -I${.CURDIR}/../libiocs | |
30 | CPPFLAGS+= -I${DESTDIR}/usr/include | 30 | CPPFLAGS+= -I${DESTDIR}/usr/include | |
31 | LDFLAGS= -nostdlib -static -N | 31 | LDFLAGS= -nostdlib -static -N | |
32 | LDLIBS= -L${LIBDOS} -ldos -L${LIBIOCS} -liocs -L${DESTDIR}/usr/lib -lc | 32 | LDLIBS= -L${LIBDOS} -ldos -L${LIBIOCS} -liocs -L${DESTDIR}/usr/lib -lc | |
33 | DPADD+= ${AOUT2HUX} | 33 | DPADD+= ${AOUT2HUX} | |
34 | 34 | |||
35 | CLEANFILES+= ${BASE}1 ${BASE}2 | 35 | CLEANFILES+= ${BASE}1 ${BASE}2 | |
36 | 36 | |||
37 | ${PROG}: ${BASE}1 ${BASE}2 | 37 | ${PROG}: ${BASE}1 ${BASE}2 | |
38 | ${_MKTARGET_LINK} | 38 | ${_MKTARGET_LINK} | |
39 | ${AOUT2HUX} -o ${.TARGET} ${BASE}1 11000 ${BASE}2 22000 | 39 | ${AOUT2HUX} -o ${.TARGET} ${BASE}1 11000 ${BASE}2 22000 | |
40 | 40 |
--- src/sys/arch/x68k/stand/loadbsd/loadbsd.c 2023/12/23 20:57:16 1.15
+++ src/sys/arch/x68k/stand/loadbsd/loadbsd.c 2024/01/07 07:58:34 1.16
@@ -10,33 +10,33 @@ | @@ -10,33 +10,33 @@ | |||
10 | * -h help | 10 | * -h help | |
11 | * -N do not actually execute kernel | 11 | * -N do not actually execute kernel | |
12 | * -V print version and exit | 12 | * -V print version and exit | |
13 | * | 13 | * | |
14 | * kernel options: | 14 | * kernel options: | |
15 | * -a auto boot, opposite of -s | 15 | * -a auto boot, opposite of -s | |
16 | * -s single user boot (default) | 16 | * -s single user boot (default) | |
17 | * -D enter kernel debugger | 17 | * -D enter kernel debugger | |
18 | * -b ask root device | 18 | * -b ask root device | |
19 | * -r specify root device | 19 | * -r specify root device | |
20 | * -q quiet boot | 20 | * -q quiet boot | |
21 | * -v verbose boot (also turn on verbosity of loadbsd) | 21 | * -v verbose boot (also turn on verbosity of loadbsd) | |
22 | * | 22 | * | |
23 | * $NetBSD: loadbsd.c,v 1.15 2023/12/23 20:57:16 andvar Exp $ | 23 | * $NetBSD: loadbsd.c,v 1.16 2024/01/07 07:58:34 isaki Exp $ | |
24 | */ | 24 | */ | |
25 | 25 | |||
26 | #include <sys/cdefs.h> | 26 | #include <sys/cdefs.h> | |
27 | 27 | |||
28 | __RCSID("$NetBSD: loadbsd.c,v 1.15 2023/12/23 20:57:16 andvar Exp $"); | 28 | __RCSID("$NetBSD: loadbsd.c,v 1.16 2024/01/07 07:58:34 isaki Exp $"); | |
29 | #define VERSION "$Revision: 1.15 $ $Date: 2023/12/23 20:57:16 $" | 29 | #define VERSION "$Revision: 1.16 $ $Date: 2024/01/07 07:58:34 $" | |
30 | 30 | |||
31 | #include <sys/types.h> /* ntohl */ | 31 | #include <sys/types.h> /* ntohl */ | |
32 | #include <sys/reboot.h> | 32 | #include <sys/reboot.h> | |
33 | #include <sys/param.h> /* ALIGN, ALIGNBYTES */ | 33 | #include <sys/param.h> /* ALIGN, ALIGNBYTES */ | |
34 | #include <a.out.h> | 34 | #include <a.out.h> | |
35 | #include <sys/exec_elf.h> | 35 | #include <sys/exec_elf.h> | |
36 | #include <string.h> | 36 | #include <string.h> | |
37 | #include <machine/bootinfo.h> | 37 | #include <machine/bootinfo.h> | |
38 | 38 | |||
39 | #include <dos.h> | 39 | #include <dos.h> | |
40 | #include <iocs.h> | 40 | #include <iocs.h> | |
41 | #include "../common/xprintf.h" | 41 | #include "../common/xprintf.h" | |
42 | #include "trampoline.h" | 42 | #include "trampoline.h" | |
@@ -355,28 +355,28 @@ read_kernel(const char *fn) | @@ -355,28 +355,28 @@ read_kernel(const char *fn) | |||
355 | xk_load(&arg->xk, buf, 0 /* XXX load addr should not be fixed */); | 355 | xk_load(&arg->xk, buf, 0 /* XXX load addr should not be fixed */); | |
356 | 356 | |||
357 | /* | 357 | /* | |
358 | * create argument for trampoline code | 358 | * create argument for trampoline code | |
359 | */ | 359 | */ | |
360 | arg->bsr_inst = TRAMP_BSR + sizeof(struct tramparg) - 2; | 360 | arg->bsr_inst = TRAMP_BSR + sizeof(struct tramparg) - 2; | |
361 | arg->tmp_stack = (char *) arg + sizeof(struct tramparg) | 361 | arg->tmp_stack = (char *) arg + sizeof(struct tramparg) | |
362 | + size_tramp + SIZE_TMPSTACK; | 362 | + size_tramp + SIZE_TMPSTACK; | |
363 | arg->mpu_type = IOCS_MPU_STAT() & 0xff; | 363 | arg->mpu_type = IOCS_MPU_STAT() & 0xff; | |
364 | 364 | |||
365 | arg->xk.d5 = IOCS_BOOTINF(); /* unused for now */ | 365 | arg->xk.d5 = IOCS_BOOTINF(); /* unused for now */ | |
366 | #if 0 | 366 | #if 0 | |
367 | /* filled afterwards */ | 367 | /* filled afterwards */ | |
368 | arg->xk.rootdev = | 368 | arg->xk.rootdev = | |
369 | arg->xk.boothowto = | 369 | arg->xk.boothowto = | |
370 | #endif | 370 | #endif | |
371 | 371 | |||
372 | if (opt_v) | 372 | if (opt_v) | |
373 | xwarnx("args: mpu %d, image %p, load 0x%x, entry 0x%x", | 373 | xwarnx("args: mpu %d, image %p, load 0x%x, entry 0x%x", | |
374 | arg->mpu_type, arg->xk.sec[0].sec_image, | 374 | arg->mpu_type, arg->xk.sec[0].sec_image, | |
375 | arg->xk.load_addr, arg->xk.entry_addr); | 375 | arg->xk.load_addr, arg->xk.entry_addr); | |
376 | 376 | |||
377 | /* | 377 | /* | |
378 | * copy trampoline code | 378 | * copy trampoline code | |
379 | */ | 379 | */ | |
380 | if (opt_v) | 380 | if (opt_v) | |
381 | xwarnx("trampoline code at %p (%u bytes)", | 381 | xwarnx("trampoline code at %p (%u bytes)", | |
382 | (char *) arg + sizeof(struct tramparg), size_tramp); | 382 | (char *) arg + sizeof(struct tramparg), size_tramp); |
--- src/sys/arch/x68k/stand/mboot/Makefile 2020/08/10 07:00:49 1.19
+++ src/sys/arch/x68k/stand/mboot/Makefile 2024/01/07 07:58:34 1.20
@@ -1,37 +1,37 @@ | @@ -1,37 +1,37 @@ | |||
1 | # $NetBSD: Makefile,v 1.19 2020/08/10 07:00:49 rin Exp $ | 1 | # $NetBSD: Makefile,v 1.20 2024/01/07 07:58:34 isaki Exp $ | |
2 | 2 | |||
3 | NOMAN= # defined | 3 | NOMAN= # defined | |
4 | .include <bsd.own.mk> | 4 | .include <bsd.own.mk> | |
5 | 5 | |||
6 | BOOT= mboot | 6 | BOOT= mboot | |
7 | VERSION= 0.1 | 7 | VERSION= 0.1 | |
8 | 8 | |||
9 | # text address | 9 | # text address | |
10 | TEXT= 00002000 | 10 | TEXT= 00002000 | |
11 | TEXTSZ= 1024 | 11 | TEXTSZ= 1024 | |
12 | 12 | |||
13 | PROG= ${BOOT} | 13 | PROG= ${BOOT} | |
14 | BINDIR= /usr/mdec | 14 | BINDIR= /usr/mdec | |
15 | BINMODE= 444 | 15 | BINMODE= 444 | |
16 | STRIPFLAG= | 16 | STRIPFLAG= | |
17 | 17 | |||
18 | SRCS= srt0.S mboot.c | 18 | SRCS= srt0.S mboot.c | |
19 | KERN!= cd ${.CURDIR}/../../../..; pwd | 19 | KERN!= cd ${.CURDIR}/../../../..; pwd | |
20 | 20 | |||
21 | CPPFLAGS+= -D_STANDALONE | 21 | CPPFLAGS+= -D_STANDALONE | |
22 | CPPFLAGS+= -nostdinc -I${KERN} -I${.CURDIR} -I. | 22 | CPPFLAGS+= -nostdinc -I${KERN} -I${.CURDIR} -I. | |
23 | CPPFLAGS+= -I${.CURDIR}/../libiocs | 23 | CPPFLAGS+= -I${.CURDIR}/../libiocs | |
24 | CPPFLAGS+= -DTEXTADDR="0x${TEXT}" | 24 | CPPFLAGS+= -DTEXTADDR="0x${TEXT}" | |
25 | CPPFLAGS+= -DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\" | 25 | CPPFLAGS+= -DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\" | |
26 | CFLAGS= -Wno-main -Os -m68000 -Wno-attributes | 26 | CFLAGS= -Wno-main -Os -m68000 -Wno-attributes | |
27 | AFLAGS+= -m68000 | 27 | AFLAGS+= -m68000 | |
28 | 28 | |||
29 | LINKFLAGS= -N -static -Ttext ${TEXT} | 29 | LINKFLAGS= -N -static -Ttext ${TEXT} | |
30 | LIBIOCS!= cd ${.CURDIR}/../libiocs && ${PRINTOBJDIR} | 30 | LIBIOCS!= cd ${.CURDIR}/../libiocs && ${PRINTOBJDIR} | |
31 | LDLIBS+= ${LIBIOCS}/libiocs.a | 31 | LDLIBS+= ${LIBIOCS}/libiocs.a | |
32 | 32 | |||
33 | .include "../Makefile.booters" | 33 | .include "../Makefile.booters" | |
34 | 34 | |||
35 | realall: ${PROG} | 35 | realall: ${PROG} | |
36 | ${BOOT}: ${OBJS} ${LDLIBS} | 36 | ${BOOT}: ${OBJS} ${LDLIBS} | |
37 | ${_MKTARGET_LINK} | 37 | ${_MKTARGET_LINK} |
--- src/sys/arch/x68k/stand/mboot/srt0.S 2008/04/28 20:23:40 1.3
+++ src/sys/arch/x68k/stand/mboot/srt0.S 2024/01/07 07:58:34 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: srt0.S,v 1.3 2008/04/28 20:23:40 martin Exp $ */ | 1 | /* $NetBSD: srt0.S,v 1.4 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Minoura Makoto. | 8 | * by Minoura Makoto. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <m68k/asm.h> | 32 | #include <m68k/asm.h> | |
33 | 33 | |||
34 | ENTRY_NOPROFILE(_start) | 34 | ENTRY_NOPROFILE(_start) | |
35 | bra start0 | 35 | bra start0 | |
36 | .ascii BOOT | 36 | .ascii BOOT | |
37 | .byte 0x20 | 37 | .byte 0x20 | |
38 | .asciz BOOT_VERS | 38 | .asciz BOOT_VERS | |
39 | .even | 39 | .even | |
40 | 40 | |||
41 | start0: | 41 | start0: | |
42 | lea %pc@(_C_LABEL(_start)),%a7 | 42 | lea %pc@(_C_LABEL(_start)),%a7 | |
43 | movl %d4,%sp@- | 43 | movl %d4,%sp@- | |
44 | bsr _C_LABEL(bootmain) | 44 | bsr _C_LABEL(bootmain) | |
45 | addql #4,%a7 | 45 | addql #4,%a7 |
--- src/sys/arch/x68k/stand/xxboot/Makefile.xxboot 2022/04/25 15:12:07 1.20
+++ src/sys/arch/x68k/stand/xxboot/Makefile.xxboot 2024/01/07 07:58:34 1.21
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile.xxboot,v 1.20 2022/04/25 15:12:07 mlelstv Exp $ | 1 | # $NetBSD: Makefile.xxboot,v 1.21 2024/01/07 07:58:34 isaki Exp $ | |
2 | 2 | |||
3 | NOMAN= # defined | 3 | NOMAN= # defined | |
4 | 4 | |||
5 | .include <bsd.own.mk> | 5 | .include <bsd.own.mk> | |
6 | 6 | |||
7 | BOOT= xxboot_$(FS) | 7 | BOOT= xxboot_$(FS) | |
8 | VERSIONFILE= ${.CURDIR}/../version | 8 | VERSIONFILE= ${.CURDIR}/../version | |
9 | VERSION!= ${TOOL_AWK} -F: '$$1 ~ /^[0-9.]*$$/ { it = $$1; } \ | 9 | VERSION!= ${TOOL_AWK} -F: '$$1 ~ /^[0-9.]*$$/ { it = $$1; } \ | |
10 | END { print it }' ${VERSIONFILE} | 10 | END { print it }' ${VERSIONFILE} | |
11 | NEWVERSWHAT= "${BOOT}" | 11 | NEWVERSWHAT= "${BOOT}" | |
12 | 12 | |||
13 | # text and bss addresses | 13 | # text and bss addresses | |
14 | TEXT= 0x003000 # Primary (me) | 14 | TEXT= 0x003000 # Primary (me) | |
@@ -56,27 +56,27 @@ LIBSA!= cd $M/stand/libsa && ${PRINTOB | @@ -56,27 +56,27 @@ LIBSA!= cd $M/stand/libsa && ${PRINTOB | |||
56 | LDLIBS= -L ${LIBSA}/lib/kern -lkern | 56 | LDLIBS= -L ${LIBSA}/lib/kern -lkern | |
57 | LDLIBS+= -L${LIBIOCS} -liocs | 57 | LDLIBS+= -L${LIBIOCS} -liocs | |
58 | 58 | |||
59 | .PATH: $S/lib/libsa | 59 | .PATH: $S/lib/libsa | |
60 | CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=$(FS) | 60 | CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=$(FS) | |
61 | CPPFLAGS+= -DLIBSA_SINGLE_DEVICE=xx | 61 | CPPFLAGS+= -DLIBSA_SINGLE_DEVICE=xx | |
62 | CPPFLAGS+= -DLIBSA_NO_FD_CHECKING | 62 | CPPFLAGS+= -DLIBSA_NO_FD_CHECKING | |
63 | CPPFLAGS+= -DLIBSA_NO_FS_WRITE | 63 | CPPFLAGS+= -DLIBSA_NO_FS_WRITE | |
64 | CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS | 64 | CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS | |
65 | CPPFLAGS+= -DLIBSA_NO_TWIDDLE | 65 | CPPFLAGS+= -DLIBSA_NO_TWIDDLE | |
66 | CPPFLAGS+= -DUSTAR_SECT_PER_CYL=30 | 66 | CPPFLAGS+= -DUSTAR_SECT_PER_CYL=30 | |
67 | SRCS+= open.c close.c read.c lseek.c loadfile.c loadfile_aout.c alloc.c | 67 | SRCS+= open.c close.c read.c lseek.c loadfile.c loadfile_aout.c alloc.c | |
68 | SRCS+= errno.c globals.c files.c | 68 | SRCS+= errno.c globals.c files.c | |
69 | SRCS+= $(FS).c | 69 | SRCS+= $(FS).c | |
70 | SRCS+= ${BOOTSRCS} | 70 | SRCS+= ${BOOTSRCS} | |
71 | 71 | |||
72 | .PATH: $M/stand/common | 72 | .PATH: $M/stand/common | |
73 | SRCS+= exec_image.S | 73 | SRCS+= exec_image.S | |
74 | 74 | |||
75 | .include "${.CURDIR}/../../Makefile.booters" | 75 | .include "${.CURDIR}/../../Makefile.booters" | |
76 | 76 | |||
77 | CLEANFILES+= ${PROG}.map | 77 | CLEANFILES+= ${PROG}.map | |
78 | 78 | |||
79 | 79 | |||
80 | ${PROG}: $(OBJS) | 80 | ${PROG}: $(OBJS) | |
81 | ${_MKTARGET_LINK} | 81 | ${_MKTARGET_LINK} | |
82 | $(LD) $(LINKFLAGS) -Map=${PROG}.map -o ${PROG} $(OBJS) $(LDLIBS) | 82 | $(LD) $(LINKFLAGS) -Map=${PROG}.map -o ${PROG} $(OBJS) $(LDLIBS) |
--- src/sys/arch/x68k/stand/xxboot/bootmain.c 2020/08/16 06:43:43 1.8
+++ src/sys/arch/x68k/stand/xxboot/bootmain.c 2024/01/07 07:58:34 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bootmain.c,v 1.8 2020/08/16 06:43:43 isaki Exp $ */ | 1 | /* $NetBSD: bootmain.c,v 1.9 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1993, 1994 Takumi Nakamura. | 4 | * Copyright (c) 1993, 1994 Takumi Nakamura. | |
5 | * Copyright (c) 1999, 2000 Itoh Yasufumi. | 5 | * Copyright (c) 1999, 2000 Itoh Yasufumi. | |
6 | * Copyright (c) 2001 Minoura Makoto. | 6 | * Copyright (c) 2001 Minoura Makoto. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -233,27 +233,27 @@ bootmain(void) | @@ -233,27 +233,27 @@ bootmain(void) | |||
233 | fd = loadfile("USTAR.volsize.4540", marks, | 233 | fd = loadfile("USTAR.volsize.4540", marks, | |
234 | LOAD_TEXT|LOAD_DATA|LOAD_BSS); | 234 | LOAD_TEXT|LOAD_DATA|LOAD_BSS); | |
235 | #else | 235 | #else | |
236 | /* XXX what is x68k/boot? */ | 236 | /* XXX what is x68k/boot? */ | |
237 | fd = loadfile("x68k/boot", marks, LOAD_TEXT|LOAD_DATA|LOAD_BSS); | 237 | fd = loadfile("x68k/boot", marks, LOAD_TEXT|LOAD_DATA|LOAD_BSS); | |
238 | if (fd < 0) | 238 | if (fd < 0) | |
239 | fd = loadfile("boot", marks, LOAD_TEXT|LOAD_DATA|LOAD_BSS); | 239 | fd = loadfile("boot", marks, LOAD_TEXT|LOAD_DATA|LOAD_BSS); | |
240 | #endif | 240 | #endif | |
241 | if (fd >= 0) { | 241 | if (fd >= 0) { | |
242 | close(fd); | 242 | close(fd); | |
243 | exec_image(BOOT_TEXTADDR, /* image loaded at */ | 243 | exec_image(BOOT_TEXTADDR, /* image loaded at */ | |
244 | BOOT_TEXTADDR, /* image executed at */ | 244 | BOOT_TEXTADDR, /* image executed at */ | |
245 | BOOT_TEXTADDR, /* XXX: entry point */ | 245 | BOOT_TEXTADDR, /* XXX: entry point */ | |
246 | 0, /* XXX: image size */ | 246 | 0, /* XXX: image size */ | |
247 | bootdev, 0); /* arguments */ | 247 | bootdev, 0); /* arguments */ | |
248 | } | 248 | } | |
249 | IOCS_B_PRINT("can't load the secondary bootstrap."); | 249 | IOCS_B_PRINT("can't load the secondary bootstrap."); | |
250 | exit(0); | 250 | exit(0); | |
251 | } | 251 | } | |
252 | 252 | |||
253 | int | 253 | int | |
254 | devopen(struct open_file *f, const char *fname, char **file) | 254 | devopen(struct open_file *f, const char *fname, char **file) | |
255 | { | 255 | { | |
256 | 256 | |||
257 | *file = __UNCONST(fname); | 257 | *file = __UNCONST(fname); | |
258 | return DEV_OPEN()(f); | 258 | return DEV_OPEN()(f); | |
259 | } | 259 | } |
--- src/sys/arch/x68k/stand/xxboot/memcmp.S 2020/08/16 06:43:43 1.1
+++ src/sys/arch/x68k/stand/xxboot/memcmp.S 2024/01/07 07:58:34 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: memcmp.S,v 1.1 2020/08/16 06:43:43 isaki Exp $ */ | 1 | /* $NetBSD: memcmp.S,v 1.2 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (C) 2020 Tetsuya Isaki. All rights reserved. | 4 | * Copyright (C) 2020 Tetsuya Isaki. All rights reserved. | |
5 | * Copyright (C) 2020 Y.Sugahara (moveccr). All rights reserved. | 5 | * Copyright (C) 2020 Y.Sugahara (moveccr). 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. | |
@@ -96,27 +96,27 @@ test: | @@ -96,27 +96,27 @@ test: | |||
96 | jbsr memcmp | 96 | jbsr memcmp | |
97 | leal %sp@(12),%sp | 97 | leal %sp@(12),%sp | |
98 | 98 | |||
99 | cmpl %a2@,%d0 | compare return value | 99 | cmpl %a2@,%d0 | compare return value | |
100 | jne fail | 100 | jne fail | |
101 | PRINT %pc@(msg_ok) | 101 | PRINT %pc@(msg_ok) | |
102 | rts | 102 | rts | |
103 | fail: | 103 | fail: | |
104 | PRINT %pc@(msg_fail) | 104 | PRINT %pc@(msg_fail) | |
105 | rts | 105 | rts | |
106 | 106 | |||
107 | test1: | 107 | test1: | |
108 | | b1 == b2 within length | 108 | | b1 == b2 within length | |
109 | .long 0x11223344 | b1 | 109 | .long 0x11223344 | b1 | |
110 | .long 0x11223355 | b2 | 110 | .long 0x11223355 | b2 | |
111 | .long 3 | len | 111 | .long 3 | len | |
112 | .long 0 | expected | 112 | .long 0 | expected | |
113 | 113 | |||
114 | test2: | 114 | test2: | |
115 | | b1 > b2 before the last | 115 | | b1 > b2 before the last | |
116 | .long 0x11813344 | b1 | 116 | .long 0x11813344 | b1 | |
117 | .long 0x11013344 | b2 | 117 | .long 0x11013344 | b2 | |
118 | .long 3 | len | 118 | .long 3 | len | |
119 | .long 0x00000080 | expected | 119 | .long 0x00000080 | expected | |
120 | 120 | |||
121 | test3: | 121 | test3: | |
122 | | b1 < b2 in the last byte | 122 | | b1 < b2 in the last byte |
--- src/sys/arch/x68k/usr.bin/loadkmap/ascii_kmap.c 2011/05/19 21:26:39 1.7
+++ src/sys/arch/x68k/usr.bin/loadkmap/ascii_kmap.c 2024/01/07 07:58:34 1.8
@@ -1,23 +1,23 @@ | @@ -1,23 +1,23 @@ | |||
1 | /* $NetBSD: ascii_kmap.c,v 1.7 2011/05/19 21:26:39 tsutsui Exp $ */ | 1 | /* $NetBSD: ascii_kmap.c,v 1.8 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | /* from: arch/amiga/dev/kbdmap.c */ | 2 | /* from: arch/amiga/dev/kbdmap.c */ | |
3 | /* modified for X680x0 by Masaru Oki */ | 3 | /* modified for X680x0 by Masaru Oki */ | |
4 | 4 | |||
5 | #include <sys/cdefs.h> | 5 | #include <sys/cdefs.h> | |
6 | __RCSID("$NetBSD: ascii_kmap.c,v 1.7 2011/05/19 21:26:39 tsutsui Exp $"); | 6 | __RCSID("$NetBSD: ascii_kmap.c,v 1.8 2024/01/07 07:58:34 isaki Exp $"); | |
7 | 7 | |||
8 | #include <machine/kbdmap.h> | 8 | #include <machine/kbdmap.h> | |
9 | 9 | |||
10 | /* define a default keymap. This can be changed by keyboard ioctl's | 10 | /* define a default keymap. This can be changed by keyboard ioctl's | |
11 | (later at least..) */ | 11 | (later at least..) */ | |
12 | 12 | |||
13 | /* mode shortcuts: */ | 13 | /* mode shortcuts: */ | |
14 | #define S KBD_MODE_STRING | 14 | #define S KBD_MODE_STRING | |
15 | #define C KBD_MODE_CAPS | 15 | #define C KBD_MODE_CAPS | |
16 | #define K KBD_MODE_KPAD | 16 | #define K KBD_MODE_KPAD | |
17 | #define D KBD_MODE_DEAD | 17 | #define D KBD_MODE_DEAD | |
18 | 18 | |||
19 | struct kbdmap ascii_kbdmap = { | 19 | struct kbdmap ascii_kbdmap = { | |
20 | /* normal map */ | 20 | /* normal map */ | |
21 | { | 21 | { | |
22 | {0, 0}, /* 0x00 */ | 22 | {0, 0}, /* 0x00 */ | |
23 | {0, ESC}, | 23 | {0, ESC}, | |
@@ -164,27 +164,27 @@ struct kbdmap ascii_kbdmap = { | @@ -164,27 +164,27 @@ struct kbdmap ascii_kbdmap = { | |||
164 | {0, '\r'}, /* return */ | 164 | {0, '\r'}, /* return */ | |
165 | {C, 'A'}, | 165 | {C, 'A'}, | |
166 | {C, 'S'}, | 166 | {C, 'S'}, | |
167 | {C, 'D'}, /* 0x20 */ | 167 | {C, 'D'}, /* 0x20 */ | |
168 | {C, 'F'}, | 168 | {C, 'F'}, | |
169 | {C, 'G'}, | 169 | {C, 'G'}, | |
170 | {C, 'H'}, | 170 | {C, 'H'}, | |
171 | {C, 'J'}, | 171 | {C, 'J'}, | |
172 | {C, 'K'}, | 172 | {C, 'K'}, | |
173 | {C, 'L'}, | 173 | {C, 'L'}, | |
174 | {0, ':'}, | 174 | {0, ':'}, | |
175 | {0, '\"'}, /* 0x28 */ | 175 | {0, '\"'}, /* 0x28 */ | |
176 | {0, '~'}, | 176 | {0, '~'}, | |
177 | {C, 'Z'}, | 177 | {C, 'Z'}, | |
178 | {C, 'X'}, | 178 | {C, 'X'}, | |
179 | {C, 'C'}, | 179 | {C, 'C'}, | |
180 | {C, 'V'}, | 180 | {C, 'V'}, | |
181 | {C, 'B'}, | 181 | {C, 'B'}, | |
182 | {C, 'N'}, | 182 | {C, 'N'}, | |
183 | {C, 'M'}, /* 0x30 */ | 183 | {C, 'M'}, /* 0x30 */ | |
184 | {0, '<'}, /* 0x38 */ | 184 | {0, '<'}, /* 0x38 */ | |
185 | {0, '>'}, | 185 | {0, '>'}, | |
186 | {0, '?'}, | 186 | {0, '?'}, | |
187 | {0, '_'}, | 187 | {0, '_'}, | |
188 | {0, ' '}, | 188 | {0, ' '}, | |
189 | {0, 0}, /* HOME */ | 189 | {0, 0}, /* HOME */ | |
190 | {0, '\b'}, /* really DEL, BS & DEL swapped */ | 190 | {0, '\b'}, /* really DEL, BS & DEL swapped */ | |
@@ -242,34 +242,34 @@ struct kbdmap ascii_kbdmap = { | @@ -242,34 +242,34 @@ struct kbdmap ascii_kbdmap = { | |||
242 | {S, 0x8D}, /* shift F9 */ | 242 | {S, 0x8D}, /* shift F9 */ | |
243 | {S, 0x93}, /* shift F10 */ | 243 | {S, 0x93}, /* shift F10 */ | |
244 | }, | 244 | }, | |
245 | 245 | |||
246 | 246 | |||
247 | /* alt map */ | 247 | /* alt map */ | |
248 | { | 248 | { | |
249 | }, | 249 | }, | |
250 | 250 | |||
251 | /* shift alt map */ | 251 | /* shift alt map */ | |
252 | { | 252 | { | |
253 | }, | 253 | }, | |
254 | 254 | |||
255 | { | 255 | { | |
256 | /* string table. If there's a better way to get the offsets into the | 256 | /* string table. If there's a better way to get the offsets into the | |
257 | above table, please tell me.. | 257 | above table, please tell me.. | |
258 | 258 | |||
259 | NOTE: save yourself and others a lot of grief by *not* using | 259 | NOTE: save yourself and others a lot of grief by *not* using | |
260 | CSI == 0x9b, using the two-character sequence gives | 260 | CSI == 0x9b, using the two-character sequence gives | |
261 | much less trouble, especially in GNU-Emacs.. */ | 261 | much less trouble, especially in GNU-Emacs.. */ | |
262 | 262 | |||
263 | 3, ESC, '[', 'A', /* 0x00: CRSR UP */ | 263 | 3, ESC, '[', 'A', /* 0x00: CRSR UP */ | |
264 | 3, ESC, '[', 'B', /* 0x04: CRSR DOWN */ | 264 | 3, ESC, '[', 'B', /* 0x04: CRSR DOWN */ | |
265 | 3, ESC, '[', 'C', /* 0x08: CRSR RIGHT */ | 265 | 3, ESC, '[', 'C', /* 0x08: CRSR RIGHT */ | |
266 | 3, ESC, '[', 'D', /* 0x0C: CRSR LEFT */ | 266 | 3, ESC, '[', 'D', /* 0x0C: CRSR LEFT */ | |
267 | 4, ESC, '[', '0', '~', /* 0x10: F1 */ | 267 | 4, ESC, '[', '0', '~', /* 0x10: F1 */ | |
268 | 4, ESC, '[', '1', '~', /* 0x15: F2 */ | 268 | 4, ESC, '[', '1', '~', /* 0x15: F2 */ | |
269 | 4, ESC, '[', '2', '~', /* 0x1A: F3 */ | 269 | 4, ESC, '[', '2', '~', /* 0x1A: F3 */ | |
270 | 4, ESC, '[', '3', '~', /* 0x1F: F4 */ | 270 | 4, ESC, '[', '3', '~', /* 0x1F: F4 */ | |
271 | 4, ESC, '[', '4', '~', /* 0x24: F5 */ | 271 | 4, ESC, '[', '4', '~', /* 0x24: F5 */ | |
272 | 4, ESC, '[', '5', '~', /* 0x29: F6 */ | 272 | 4, ESC, '[', '5', '~', /* 0x29: F6 */ | |
273 | 4, ESC, '[', '6', '~', /* 0x2E: F7 */ | 273 | 4, ESC, '[', '6', '~', /* 0x2E: F7 */ | |
274 | 4, ESC, '[', '7', '~', /* 0x33: F8 */ | 274 | 4, ESC, '[', '7', '~', /* 0x33: F8 */ | |
275 | 4, ESC, '[', '8', '~', /* 0x38: F9 */ | 275 | 4, ESC, '[', '8', '~', /* 0x38: F9 */ |
--- src/sys/arch/x68k/usr.bin/loadkmap/jis_kmap.c 2011/05/19 21:26:39 1.6
+++ src/sys/arch/x68k/usr.bin/loadkmap/jis_kmap.c 2024/01/07 07:58:34 1.7
@@ -1,23 +1,23 @@ | @@ -1,23 +1,23 @@ | |||
1 | /* $NetBSD: jis_kmap.c,v 1.6 2011/05/19 21:26:39 tsutsui Exp $ */ | 1 | /* $NetBSD: jis_kmap.c,v 1.7 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | /* from: arch/amiga/dev/kbdmap.c */ | 2 | /* from: arch/amiga/dev/kbdmap.c */ | |
3 | /* modified for X680x0 by Masaru Oki */ | 3 | /* modified for X680x0 by Masaru Oki */ | |
4 | 4 | |||
5 | #include <sys/cdefs.h> | 5 | #include <sys/cdefs.h> | |
6 | __RCSID("$NetBSD: jis_kmap.c,v 1.6 2011/05/19 21:26:39 tsutsui Exp $"); | 6 | __RCSID("$NetBSD: jis_kmap.c,v 1.7 2024/01/07 07:58:34 isaki Exp $"); | |
7 | 7 | |||
8 | #include <machine/kbdmap.h> | 8 | #include <machine/kbdmap.h> | |
9 | 9 | |||
10 | /* define a default keymap. This can be changed by keyboard ioctl's | 10 | /* define a default keymap. This can be changed by keyboard ioctl's | |
11 | (later at least..) */ | 11 | (later at least..) */ | |
12 | 12 | |||
13 | /* mode shortcuts: */ | 13 | /* mode shortcuts: */ | |
14 | #define S KBD_MODE_STRING | 14 | #define S KBD_MODE_STRING | |
15 | #define C KBD_MODE_CAPS | 15 | #define C KBD_MODE_CAPS | |
16 | #define K KBD_MODE_KPAD | 16 | #define K KBD_MODE_KPAD | |
17 | #define D KBD_MODE_DEAD | 17 | #define D KBD_MODE_DEAD | |
18 | 18 | |||
19 | struct kbdmap ascii_kbdmap = { | 19 | struct kbdmap ascii_kbdmap = { | |
20 | /* normal map */ | 20 | /* normal map */ | |
21 | { | 21 | { | |
22 | {0, 0}, /* 0x00 */ | 22 | {0, 0}, /* 0x00 */ | |
23 | {0, ESC}, | 23 | {0, ESC}, | |
@@ -164,27 +164,27 @@ struct kbdmap ascii_kbdmap = { | @@ -164,27 +164,27 @@ struct kbdmap ascii_kbdmap = { | |||
164 | {0, '\r'}, /* return */ | 164 | {0, '\r'}, /* return */ | |
165 | {C, 'A'}, | 165 | {C, 'A'}, | |
166 | {C, 'S'}, | 166 | {C, 'S'}, | |
167 | {C, 'D'}, /* 0x20 */ | 167 | {C, 'D'}, /* 0x20 */ | |
168 | {C, 'F'}, | 168 | {C, 'F'}, | |
169 | {C, 'G'}, | 169 | {C, 'G'}, | |
170 | {C, 'H'}, | 170 | {C, 'H'}, | |
171 | {C, 'J'}, | 171 | {C, 'J'}, | |
172 | {C, 'K'}, | 172 | {C, 'K'}, | |
173 | {C, 'L'}, | 173 | {C, 'L'}, | |
174 | {0, '+'}, | 174 | {0, '+'}, | |
175 | {0, '*'}, /* 0x28 */ | 175 | {0, '*'}, /* 0x28 */ | |
176 | {0, '}'}, | 176 | {0, '}'}, | |
177 | {C, 'Z'}, | 177 | {C, 'Z'}, | |
178 | {C, 'X'}, | 178 | {C, 'X'}, | |
179 | {C, 'C'}, | 179 | {C, 'C'}, | |
180 | {C, 'V'}, | 180 | {C, 'V'}, | |
181 | {C, 'B'}, | 181 | {C, 'B'}, | |
182 | {C, 'N'}, | 182 | {C, 'N'}, | |
183 | {C, 'M'}, /* 0x30 */ | 183 | {C, 'M'}, /* 0x30 */ | |
184 | {0, '<'}, /* 0x38 */ | 184 | {0, '<'}, /* 0x38 */ | |
185 | {0, '>'}, | 185 | {0, '>'}, | |
186 | {0, '?'}, | 186 | {0, '?'}, | |
187 | {0, '_'}, | 187 | {0, '_'}, | |
188 | {0, ' '}, | 188 | {0, ' '}, | |
189 | {0, 0}, /* HOME */ | 189 | {0, 0}, /* HOME */ | |
190 | {0, '\b'}, /* really DEL, BS & DEL swapped */ | 190 | {0, '\b'}, /* really DEL, BS & DEL swapped */ | |
@@ -242,34 +242,34 @@ struct kbdmap ascii_kbdmap = { | @@ -242,34 +242,34 @@ struct kbdmap ascii_kbdmap = { | |||
242 | {S, 0x8D}, /* shift F9 */ | 242 | {S, 0x8D}, /* shift F9 */ | |
243 | {S, 0x93}, /* shift F10 */ | 243 | {S, 0x93}, /* shift F10 */ | |
244 | }, | 244 | }, | |
245 | 245 | |||
246 | 246 | |||
247 | /* alt map */ | 247 | /* alt map */ | |
248 | { | 248 | { | |
249 | }, | 249 | }, | |
250 | 250 | |||
251 | /* shift alt map */ | 251 | /* shift alt map */ | |
252 | { | 252 | { | |
253 | }, | 253 | }, | |
254 | 254 | |||
255 | { | 255 | { | |
256 | /* string table. If there's a better way to get the offsets into the | 256 | /* string table. If there's a better way to get the offsets into the | |
257 | above table, please tell me.. | 257 | above table, please tell me.. | |
258 | 258 | |||
259 | NOTE: save yourself and others a lot of grief by *not* using | 259 | NOTE: save yourself and others a lot of grief by *not* using | |
260 | CSI == 0x9b, using the two-character sequence gives | 260 | CSI == 0x9b, using the two-character sequence gives | |
261 | much less trouble, especially in GNU-Emacs.. */ | 261 | much less trouble, especially in GNU-Emacs.. */ | |
262 | 262 | |||
263 | 3, ESC, '[', 'A', /* 0x00: CRSR UP */ | 263 | 3, ESC, '[', 'A', /* 0x00: CRSR UP */ | |
264 | 3, ESC, '[', 'B', /* 0x04: CRSR DOWN */ | 264 | 3, ESC, '[', 'B', /* 0x04: CRSR DOWN */ | |
265 | 3, ESC, '[', 'C', /* 0x08: CRSR RIGHT */ | 265 | 3, ESC, '[', 'C', /* 0x08: CRSR RIGHT */ | |
266 | 3, ESC, '[', 'D', /* 0x0C: CRSR LEFT */ | 266 | 3, ESC, '[', 'D', /* 0x0C: CRSR LEFT */ | |
267 | 4, ESC, '[', '0', '~', /* 0x10: F1 */ | 267 | 4, ESC, '[', '0', '~', /* 0x10: F1 */ | |
268 | 4, ESC, '[', '1', '~', /* 0x15: F2 */ | 268 | 4, ESC, '[', '1', '~', /* 0x15: F2 */ | |
269 | 4, ESC, '[', '2', '~', /* 0x1A: F3 */ | 269 | 4, ESC, '[', '2', '~', /* 0x1A: F3 */ | |
270 | 4, ESC, '[', '3', '~', /* 0x1F: F4 */ | 270 | 4, ESC, '[', '3', '~', /* 0x1F: F4 */ | |
271 | 4, ESC, '[', '4', '~', /* 0x24: F5 */ | 271 | 4, ESC, '[', '4', '~', /* 0x24: F5 */ | |
272 | 4, ESC, '[', '5', '~', /* 0x29: F6 */ | 272 | 4, ESC, '[', '5', '~', /* 0x29: F6 */ | |
273 | 4, ESC, '[', '6', '~', /* 0x2E: F7 */ | 273 | 4, ESC, '[', '6', '~', /* 0x2E: F7 */ | |
274 | 4, ESC, '[', '7', '~', /* 0x33: F8 */ | 274 | 4, ESC, '[', '7', '~', /* 0x33: F8 */ | |
275 | 4, ESC, '[', '8', '~', /* 0x38: F9 */ | 275 | 4, ESC, '[', '8', '~', /* 0x38: F9 */ |
--- src/sys/arch/x68k/usr.bin/loadkmap/kbdmap.h 1998/01/05 20:52:29 1.2
+++ src/sys/arch/x68k/usr.bin/loadkmap/kbdmap.h 2024/01/07 07:58:34 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kbdmap.h,v 1.2 1998/01/05 20:52:29 perry Exp $ */ | 1 | /* $NetBSD: kbdmap.h,v 1.3 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | 2 | |||
3 | #define NUL 0 | 3 | #define NUL 0 | |
4 | #define SOH 1 | 4 | #define SOH 1 | |
5 | #define STX 2 | 5 | #define STX 2 | |
6 | #define ETX 3 | 6 | #define ETX 3 | |
7 | #define EOT 4 | 7 | #define EOT 4 | |
8 | #define ENQ 5 | 8 | #define ENQ 5 | |
9 | #define ACK 6 | 9 | #define ACK 6 | |
10 | #define BEL 7 | 10 | #define BEL 7 | |
11 | #define BS 8 | 11 | #define BS 8 | |
12 | #define HT 9 | 12 | #define HT 9 | |
13 | #define LF 10 | 13 | #define LF 10 | |
14 | #define VT 11 | 14 | #define VT 11 | |
@@ -84,26 +84,26 @@ struct key { | @@ -84,26 +84,26 @@ struct key { | |||
84 | #define KBD_MODE_STRING (1<<0) /* code is index into strings[] */ | 84 | #define KBD_MODE_STRING (1<<0) /* code is index into strings[] */ | |
85 | #define KBD_MODE_DEAD (1<<1) /* acc-index in upper nibble, code = plain acc */ | 85 | #define KBD_MODE_DEAD (1<<1) /* acc-index in upper nibble, code = plain acc */ | |
86 | #define KBD_MODE_CAPS (1<<2) /* key is capsable. Only used in non-shifted maps */ | 86 | #define KBD_MODE_CAPS (1<<2) /* key is capsable. Only used in non-shifted maps */ | |
87 | #define KBD_MODE_KPAD (1<<3) /* key is on keypad */ | 87 | #define KBD_MODE_KPAD (1<<3) /* key is on keypad */ | |
88 | #define KBD_MODE_GRAVE (KBD_ACC_GRAVE << 4) | 88 | #define KBD_MODE_GRAVE (KBD_ACC_GRAVE << 4) | |
89 | #define KBD_MODE_ACUTE (KBD_ACC_ACUTE << 4) | 89 | #define KBD_MODE_ACUTE (KBD_ACC_ACUTE << 4) | |
90 | #define KBD_MODE_CIRC (KBD_ACC_CIRC << 4) | 90 | #define KBD_MODE_CIRC (KBD_ACC_CIRC << 4) | |
91 | #define KBD_MODE_TILDE (KBD_ACC_TILDE << 4) | 91 | #define KBD_MODE_TILDE (KBD_ACC_TILDE << 4) | |
92 | #define KBD_MODE_DIER (KBD_ACC_DIER << 4) | 92 | #define KBD_MODE_DIER (KBD_ACC_DIER << 4) | |
93 | #define KBD_MODE_ACCENT(m) ((m) >> 4) /* get accent from mode */ | 93 | #define KBD_MODE_ACCENT(m) ((m) >> 4) /* get accent from mode */ | |
94 | #define KBD_MODE_ACCMASK (0xf0) | 94 | #define KBD_MODE_ACCMASK (0xf0) | |
95 | 95 | |||
96 | struct kbdmap { | 96 | struct kbdmap { | |
97 | struct key keys[KBD_NUM_KEYS], | 97 | struct key keys[KBD_NUM_KEYS], | |
98 | shift_keys[KBD_NUM_KEYS], | 98 | shift_keys[KBD_NUM_KEYS], | |
99 | alt_keys[KBD_NUM_KEYS], | 99 | alt_keys[KBD_NUM_KEYS], | |
100 | alt_shift_keys[KBD_NUM_KEYS]; | 100 | alt_shift_keys[KBD_NUM_KEYS]; | |
101 | unsigned char strings[KBD_STRTAB_SIZE]; | 101 | unsigned char strings[KBD_STRTAB_SIZE]; | |
102 | }; | 102 | }; | |
103 | 103 | |||
104 | 104 | |||
105 | #ifdef KERNEL | 105 | #ifdef KERNEL | |
106 | /* XXX: ITE interface */ | 106 | /* XXX: ITE interface */ | |
107 | extern struct kbdmap kbdmap, ascii_kbdmap; | 107 | extern struct kbdmap kbdmap, ascii_kbdmap; | |
108 | extern unsigned char acctable[KBD_NUM_ACC][64]; | 108 | extern unsigned char acctable[KBD_NUM_ACC][64]; | |
109 | #endif | 109 | #endif |
--- src/sys/arch/x68k/usr.bin/loadkmap/loadkmap.c 2011/05/19 21:26:39 1.10
+++ src/sys/arch/x68k/usr.bin/loadkmap/loadkmap.c 2024/01/07 07:58:34 1.11
@@ -1,22 +1,22 @@ | @@ -1,22 +1,22 @@ | |||
1 | /* $NetBSD: loadkmap.c,v 1.10 2011/05/19 21:26:39 tsutsui Exp $ */ | 1 | /* $NetBSD: loadkmap.c,v 1.11 2024/01/07 07:58:34 isaki Exp $ */ | |
2 | /* | 2 | /* | |
3 | * loadkmap - load keyboard map (for NetBSD/X680x0) | 3 | * loadkmap - load keyboard map (for NetBSD/X680x0) | |
4 | * from: amiga/stand/loadkmap/loadkmap.c | 4 | * from: amiga/stand/loadkmap/loadkmap.c | |
5 | * Copyright 1994 by Masaru Oki | 5 | * Copyright 1994 by Masaru Oki | |
6 | */ | 6 | */ | |
7 | 7 | |||
8 | #include <sys/cdefs.h> | 8 | #include <sys/cdefs.h> | |
9 | __RCSID("$NetBSD: loadkmap.c,v 1.10 2011/05/19 21:26:39 tsutsui Exp $"); | 9 | __RCSID("$NetBSD: loadkmap.c,v 1.11 2024/01/07 07:58:34 isaki Exp $"); | |
10 | 10 | |||
11 | #include <stdio.h> | 11 | #include <stdio.h> | |
12 | #include <stdlib.h> | 12 | #include <stdlib.h> | |
13 | #include <unistd.h> | 13 | #include <unistd.h> | |
14 | #include <fcntl.h> | 14 | #include <fcntl.h> | |
15 | #include <sys/types.h> | 15 | #include <sys/types.h> | |
16 | #include <sys/ioctl.h> | 16 | #include <sys/ioctl.h> | |
17 | #include <machine/kbdmap.h> | 17 | #include <machine/kbdmap.h> | |
18 | #include <machine/iteioctl.h> | 18 | #include <machine/iteioctl.h> | |
19 | 19 | |||
20 | void load_kmap(const char *); | 20 | void load_kmap(const char *); | |
21 | 21 | |||
22 | int | 22 | int | |
@@ -40,16 +40,16 @@ load_kmap(const char *file) | @@ -40,16 +40,16 @@ load_kmap(const char *file) | |||
40 | 40 | |||
41 | if ((fd = open(file, 0)) >= 0) { | 41 | if ((fd = open(file, 0)) >= 0) { | |
42 | if (read(fd, buf, sizeof(buf)) == sizeof(buf)) { | 42 | if (read(fd, buf, sizeof(buf)) == sizeof(buf)) { | |
43 | if (ioctl(0, ITEIOCSKMAP, buf) == 0) | 43 | if (ioctl(0, ITEIOCSKMAP, buf) == 0) | |
44 | return; | 44 | return; | |
45 | else | 45 | else | |
46 | perror("ITEIOCSKMAP"); | 46 | perror("ITEIOCSKMAP"); | |
47 | } else { | 47 | } else { | |
48 | perror("read kbdmap"); | 48 | perror("read kbdmap"); | |
49 | } | 49 | } | |
50 | 50 | |||
51 | close (fd); | 51 | close (fd); | |
52 | } else { | 52 | } else { | |
53 | perror("open kbdmap"); | 53 | perror("open kbdmap"); | |
54 | } | 54 | } | |
55 | } | 55 | } |
--- src/sys/arch/x68k/x68k/autoconf.c 2014/03/26 08:17:59 1.68
+++ src/sys/arch/x68k/x68k/autoconf.c 2024/01/07 07:58:35 1.69
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: autoconf.c,v 1.68 2014/03/26 08:17:59 christos Exp $ */ | 1 | /* $NetBSD: autoconf.c,v 1.69 2024/01/07 07:58:35 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1995 Leo Weppelman | 4 | * Copyright (c) 1995 Leo Weppelman | |
5 | * Copyright (c) 1994 Christian E. Hopps | 5 | * Copyright (c) 1994 Christian E. Hopps | |
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. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.68 2014/03/26 08:17:59 christos Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.69 2024/01/07 07:58:35 isaki Exp $"); | |
35 | 35 | |||
36 | #include "opt_compat_netbsd.h" | 36 | #include "opt_compat_netbsd.h" | |
37 | #include "scsibus.h" | 37 | #include "scsibus.h" | |
38 | 38 | |||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/systm.h> | 40 | #include <sys/systm.h> | |
41 | #include <sys/reboot.h> | 41 | #include <sys/reboot.h> | |
42 | #include <sys/conf.h> | 42 | #include <sys/conf.h> | |
43 | #include <sys/device.h> | 43 | #include <sys/device.h> | |
44 | #include <sys/disk.h> | 44 | #include <sys/disk.h> | |
45 | #include <sys/disklabel.h> | 45 | #include <sys/disklabel.h> | |
46 | #include <machine/cpu.h> | 46 | #include <machine/cpu.h> | |
47 | #include <machine/bootinfo.h> | 47 | #include <machine/bootinfo.h> | |
@@ -75,27 +75,27 @@ cpu_configure(void) | @@ -75,27 +75,27 @@ cpu_configure(void) | |||
75 | void | 75 | void | |
76 | cpu_rootconf(void) | 76 | cpu_rootconf(void) | |
77 | { | 77 | { | |
78 | findroot(); | 78 | findroot(); | |
79 | 79 | |||
80 | printf("boot device: %s\n", | 80 | printf("boot device: %s\n", | |
81 | booted_device ? device_xname(booted_device) : "<unknown>"); | 81 | booted_device ? device_xname(booted_device) : "<unknown>"); | |
82 | 82 | |||
83 | rootconf(); | 83 | rootconf(); | |
84 | } | 84 | } | |
85 | 85 | |||
86 | void | 86 | void | |
87 | config_console(void) | 87 | config_console(void) | |
88 | { | 88 | { | |
89 | mfp_config_console(); | 89 | mfp_config_console(); | |
90 | grf_config_console(); | 90 | grf_config_console(); | |
91 | ite_config_console(); | 91 | ite_config_console(); | |
92 | } | 92 | } | |
93 | 93 | |||
94 | uint32_t bootdev = 0; | 94 | uint32_t bootdev = 0; | |
95 | 95 | |||
96 | static void | 96 | static void | |
97 | findroot(void) | 97 | findroot(void) | |
98 | { | 98 | { | |
99 | int majdev, unit, part; | 99 | int majdev, unit, part; | |
100 | const char *name; | 100 | const char *name; | |
101 | 101 |
--- src/sys/arch/x68k/x68k/bus.c 2022/07/26 20:08:56 1.38
+++ src/sys/arch/x68k/x68k/bus.c 2024/01/07 07:58:35 1.39
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bus.c,v 1.38 2022/07/26 20:08:56 andvar Exp $ */ | 1 | /* $NetBSD: bus.c,v 1.39 2024/01/07 07:58:35 isaki Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -27,27 +27,27 @@ | @@ -27,27 +27,27 @@ | |||
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * bus_space(9) and bus_dma(9) implementation for NetBSD/x68k. | 33 | * bus_space(9) and bus_dma(9) implementation for NetBSD/x68k. | |
34 | * These are default implementations; some buses may use their own. | 34 | * These are default implementations; some buses may use their own. | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #include "opt_m68k_arch.h" | 37 | #include "opt_m68k_arch.h" | |
38 | 38 | |||
39 | #include <sys/cdefs.h> | 39 | #include <sys/cdefs.h> | |
40 | __KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.38 2022/07/26 20:08:56 andvar Exp $"); | 40 | __KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.39 2024/01/07 07:58:35 isaki Exp $"); | |
41 | 41 | |||
42 | #include <sys/param.h> | 42 | #include <sys/param.h> | |
43 | #include <sys/systm.h> | 43 | #include <sys/systm.h> | |
44 | #include <sys/malloc.h> | 44 | #include <sys/malloc.h> | |
45 | #include <sys/mbuf.h> | 45 | #include <sys/mbuf.h> | |
46 | #include <sys/kernel.h> | 46 | #include <sys/kernel.h> | |
47 | #include <sys/conf.h> | 47 | #include <sys/conf.h> | |
48 | #include <sys/device.h> | 48 | #include <sys/device.h> | |
49 | #include <sys/proc.h> | 49 | #include <sys/proc.h> | |
50 | 50 | |||
51 | #include <uvm/uvm_extern.h> | 51 | #include <uvm/uvm_extern.h> | |
52 | 52 | |||
53 | #include <m68k/cacheops.h> | 53 | #include <m68k/cacheops.h> | |
@@ -357,27 +357,27 @@ x68k_bus_dmamap_sync(bus_dma_tag_t t, bu | @@ -357,27 +357,27 @@ x68k_bus_dmamap_sync(bus_dma_tag_t t, bu | |||
357 | bus_dma_segment_t *ds = map->dm_segs; | 357 | bus_dma_segment_t *ds = map->dm_segs; | |
358 | bus_addr_t seg; | 358 | bus_addr_t seg; | |
359 | int i; | 359 | int i; | |
360 | 360 | |||
361 | if ((ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_POSTWRITE)) == 0) | 361 | if ((ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_POSTWRITE)) == 0) | |
362 | return; | 362 | return; | |
363 | #if defined(M68020) || defined(M68030) | 363 | #if defined(M68020) || defined(M68030) | |
364 | if (mmutype != MMU_68040) { | 364 | if (mmutype != MMU_68040) { | |
365 | if ((ops & BUS_DMASYNC_POSTWRITE) == 0) | 365 | if ((ops & BUS_DMASYNC_POSTWRITE) == 0) | |
366 | return; /* no copyback cache */ | 366 | return; /* no copyback cache */ | |
367 | ICIA(); /* no per-page/per-line control */ | 367 | ICIA(); /* no per-page/per-line control */ | |
368 | DCIA(); | 368 | DCIA(); | |
369 | return; | 369 | return; | |
370 | } | 370 | } | |
371 | #endif | 371 | #endif | |
372 | if (offset >= map->dm_mapsize) | 372 | if (offset >= map->dm_mapsize) | |
373 | return; /* driver bug; warn it? */ | 373 | return; /* driver bug; warn it? */ | |
374 | if (offset+len > map->dm_mapsize) | 374 | if (offset+len > map->dm_mapsize) | |
375 | len = map->dm_mapsize; /* driver bug; warn it? */ | 375 | len = map->dm_mapsize; /* driver bug; warn it? */ | |
376 | 376 | |||
377 | i = 0; | 377 | i = 0; | |
378 | while (ds[i].ds_len <= offset) { | 378 | while (ds[i].ds_len <= offset) { | |
379 | offset -= ds[i++].ds_len; | 379 | offset -= ds[i++].ds_len; | |
380 | continue; | 380 | continue; | |
381 | } | 381 | } | |
382 | while (len > 0) { | 382 | while (len > 0) { | |
383 | seg = ds[i].ds_len - offset; | 383 | seg = ds[i].ds_len - offset; | |
@@ -451,27 +451,27 @@ x68k_bus_dmamem_unmap(bus_dma_tag_t t, v | @@ -451,27 +451,27 @@ x68k_bus_dmamem_unmap(bus_dma_tag_t t, v | |||
451 | /* | 451 | /* | |
452 | * Common function for mmap(2)'ing DMA-safe memory. May be called by | 452 | * Common function for mmap(2)'ing DMA-safe memory. May be called by | |
453 | * bus-specific DMA mmap(2)'ing functions. | 453 | * bus-specific DMA mmap(2)'ing functions. | |
454 | */ | 454 | */ | |
455 | paddr_t | 455 | paddr_t | |
456 | x68k_bus_dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, | 456 | x68k_bus_dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, | |
457 | off_t off, int prot, int flags) | 457 | off_t off, int prot, int flags) | |
458 | { | 458 | { | |
459 | bus_addr_t rv; | 459 | bus_addr_t rv; | |
460 | 460 | |||
461 | rv = _bus_dmamem_mmap_common(t, segs, nsegs, off, prot, flags); | 461 | rv = _bus_dmamem_mmap_common(t, segs, nsegs, off, prot, flags); | |
462 | if (rv == (bus_addr_t)-1) | 462 | if (rv == (bus_addr_t)-1) | |
463 | return (-1); | 463 | return (-1); | |
464 | 464 | |||
465 | return (m68k_btop((char *)rv)); | 465 | return (m68k_btop((char *)rv)); | |
466 | } | 466 | } | |
467 | 467 | |||
468 | 468 | |||
469 | /********************************************************************** | 469 | /********************************************************************** | |
470 | * DMA utility functions | 470 | * DMA utility functions | |
471 | **********************************************************************/ | 471 | **********************************************************************/ | |
472 | 472 | |||
473 | /* | 473 | /* | |
474 | * Utility function to load a linear buffer. lastaddrp holds state | 474 | * Utility function to load a linear buffer. lastaddrp holds state | |
475 | * between invocations (for multiple-buffer loads). segp contains | 475 | * between invocations (for multiple-buffer loads). segp contains | |
476 | * the starting segment on entrance, and the ending segment on exit. | 476 | * the starting segment on entrance, and the ending segment on exit. | |
477 | * first indicates if this is the first invocation of this function. | 477 | * first indicates if this is the first invocation of this function. |
--- src/sys/arch/x68k/x68k/clock.c 2023/12/20 00:40:44 1.35
+++ src/sys/arch/x68k/x68k/clock.c 2024/01/07 07:58:35 1.36
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: clock.c,v 1.35 2023/12/20 00:40:44 thorpej Exp $ */ | 1 | /* $NetBSD: clock.c,v 1.36 2024/01/07 07:58:35 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988 University of Utah. | 4 | * Copyright (c) 1988 University of Utah. | |
5 | * Copyright (c) 1982, 1990, 1993 | 5 | * Copyright (c) 1982, 1990, 1993 | |
6 | * The Regents of the University of California. All rights reserved. | 6 | * The Regents of the University of California. All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department. | 10 | * Science Department. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -29,27 +29,27 @@ | @@ -29,27 +29,27 @@ | |||
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | * SUCH DAMAGE. | 34 | * SUCH DAMAGE. | |
35 | * | 35 | * | |
36 | * from: Utah $Hdr: clock.c 1.18 91/01/21$ | 36 | * from: Utah $Hdr: clock.c 1.18 91/01/21$ | |
37 | * | 37 | * | |
38 | * @(#)clock.c 8.2 (Berkeley) 1/12/94 | 38 | * @(#)clock.c 8.2 (Berkeley) 1/12/94 | |
39 | */ | 39 | */ | |
40 | 40 | |||
41 | #include <sys/cdefs.h> | 41 | #include <sys/cdefs.h> | |
42 | __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.35 2023/12/20 00:40:44 thorpej Exp $"); | 42 | __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.36 2024/01/07 07:58:35 isaki Exp $"); | |
43 | 43 | |||
44 | #include "clock.h" | 44 | #include "clock.h" | |
45 | 45 | |||
46 | #if NCLOCK > 0 | 46 | #if NCLOCK > 0 | |
47 | 47 | |||
48 | #include <sys/param.h> | 48 | #include <sys/param.h> | |
49 | #include <sys/systm.h> | 49 | #include <sys/systm.h> | |
50 | #include <sys/kernel.h> | 50 | #include <sys/kernel.h> | |
51 | #include <sys/device.h> | 51 | #include <sys/device.h> | |
52 | #include <sys/timetc.h> | 52 | #include <sys/timetc.h> | |
53 | 53 | |||
54 | #include <machine/psl.h> | 54 | #include <machine/psl.h> | |
55 | #include <machine/cpu.h> | 55 | #include <machine/cpu.h> | |
@@ -120,27 +120,27 @@ clock_attach(device_t parent, device_t s | @@ -120,27 +120,27 @@ clock_attach(device_t parent, device_t s | |||
120 | * no alternative timer is available. | 120 | * no alternative timer is available. | |
121 | * | 121 | * | |
122 | */ | 122 | */ | |
123 | void | 123 | void | |
124 | cpu_initclocks(void) | 124 | cpu_initclocks(void) | |
125 | { | 125 | { | |
126 | static struct timecounter tc = { | 126 | static struct timecounter tc = { | |
127 | .tc_name = "mfp", | 127 | .tc_name = "mfp", | |
128 | .tc_frequency = CLOCKS_PER_SEC, | 128 | .tc_frequency = CLOCKS_PER_SEC, | |
129 | .tc_counter_mask = 0xff, | 129 | .tc_counter_mask = 0xff, | |
130 | .tc_get_timecount = mfp_get_timecount, | 130 | .tc_get_timecount = mfp_get_timecount, | |
131 | .tc_quality = 100, | 131 | .tc_quality = 100, | |
132 | }; | 132 | }; | |
133 | 133 | |||
134 | if (CLOCKS_PER_SEC % hz || | 134 | if (CLOCKS_PER_SEC % hz || | |
135 | hz <= (CLOCKS_PER_SEC / 256) || hz > CLOCKS_PER_SEC) { | 135 | hz <= (CLOCKS_PER_SEC / 256) || hz > CLOCKS_PER_SEC) { | |
136 | printf("cannot set %d Hz clock. using 100 Hz\n", hz); | 136 | printf("cannot set %d Hz clock. using 100 Hz\n", hz); | |
137 | hz = 100; | 137 | hz = 100; | |
138 | } | 138 | } | |
139 | 139 | |||
140 | mfp_set_tcdcr(0); /* stop timers C and D */ | 140 | mfp_set_tcdcr(0); /* stop timers C and D */ | |
141 | mfp_set_tcdcr(mfp_get_tcdcr() | 0x70); /* 1/200 delay mode */ | 141 | mfp_set_tcdcr(mfp_get_tcdcr() | 0x70); /* 1/200 delay mode */ | |
142 | 142 | |||
143 | mfp_set_tcdr(CLOCKS_PER_SEC / hz); | 143 | mfp_set_tcdr(CLOCKS_PER_SEC / hz); | |
144 | mfp_bit_set_ierb(MFP_INTR_TIMER_C); | 144 | mfp_bit_set_ierb(MFP_INTR_TIMER_C); | |
145 | 145 | |||
146 | mfp_set_tddr(0); /* maximum free run -- only 8 bits wide */ | 146 | mfp_set_tddr(0); /* maximum free run -- only 8 bits wide */ | |
@@ -265,27 +265,27 @@ int | @@ -265,27 +265,27 @@ int | |||
265 | clockclose(dev_t dev, int flags) | 265 | clockclose(dev_t dev, int flags) | |
266 | { | 266 | { | |
267 | (void) clockunmmap(dev, NULL, curproc); /* XXX */ | 267 | (void) clockunmmap(dev, NULL, curproc); /* XXX */ | |
268 | stopclock(); | 268 | stopclock(); | |
269 | clockon = 0; | 269 | clockon = 0; | |
270 | return(0); | 270 | return(0); | |
271 | } | 271 | } | |
272 | 272 | |||
273 | /*ARGSUSED*/ | 273 | /*ARGSUSED*/ | |
274 | int | 274 | int | |
275 | clockioctl(dev_t dev, u_long cmd, void *data, int flag, struct proc *p) | 275 | clockioctl(dev_t dev, u_long cmd, void *data, int flag, struct proc *p) | |
276 | { | 276 | { | |
277 | int error = 0; | 277 | int error = 0; | |
278 | 278 | |||
279 | switch (cmd) { | 279 | switch (cmd) { | |
280 | 280 | |||
281 | case CLOCKMAP: | 281 | case CLOCKMAP: | |
282 | error = clockmmap(dev, (void **)data, p); | 282 | error = clockmmap(dev, (void **)data, p); | |
283 | break; | 283 | break; | |
284 | 284 | |||
285 | case CLOCKUNMAP: | 285 | case CLOCKUNMAP: | |
286 | error = clockunmmap(dev, *(void **)data, p); | 286 | error = clockunmmap(dev, *(void **)data, p); | |
287 | break; | 287 | break; | |
288 | 288 | |||
289 | case CLOCKGETRES: | 289 | case CLOCKGETRES: | |
290 | *(int *)data = CLK_RESOLUTION; | 290 | *(int *)data = CLK_RESOLUTION; | |
291 | break; | 291 | break; |
--- src/sys/arch/x68k/x68k/disksubr.c 2020/06/18 19:54:08 1.36
+++ src/sys/arch/x68k/x68k/disksubr.c 2024/01/07 07:58:35 1.37
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: disksubr.c,v 1.36 2020/06/18 19:54:08 tsutsui Exp $ */ | 1 | /* $NetBSD: disksubr.c,v 1.37 2024/01/07 07:58:35 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1982, 1986, 1988 Regents of the University of California. | 4 | * Copyright (c) 1982, 1986, 1988 Regents of the University of California. | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -22,27 +22,27 @@ | @@ -22,27 +22,27 @@ | |||
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | * | 30 | * | |
31 | * @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 | 31 | * @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 | |
32 | */ | 32 | */ | |
33 | 33 | |||
34 | #include <sys/cdefs.h> | 34 | #include <sys/cdefs.h> | |
35 | __KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.36 2020/06/18 19:54:08 tsutsui Exp $"); | 35 | __KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.37 2024/01/07 07:58:35 isaki Exp $"); | |
36 | 36 | |||
37 | #include "opt_compat_netbsd.h" | 37 | #include "opt_compat_netbsd.h" | |
38 | 38 | |||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/systm.h> | 40 | #include <sys/systm.h> | |
41 | #include <sys/buf.h> | 41 | #include <sys/buf.h> | |
42 | #include <sys/disklabel.h> | 42 | #include <sys/disklabel.h> | |
43 | #include <sys/syslog.h> | 43 | #include <sys/syslog.h> | |
44 | #include <sys/disk.h> | 44 | #include <sys/disk.h> | |
45 | 45 | |||
46 | /* get rid of DEV_BSIZE dependency */ | 46 | /* get rid of DEV_BSIZE dependency */ | |
47 | #define DEF_BSIZE DEV_BSIZE /* default sector size = 512 */ | 47 | #define DEF_BSIZE DEV_BSIZE /* default sector size = 512 */ | |
48 | 48 | |||
@@ -394,27 +394,27 @@ dodospart: | @@ -394,27 +394,27 @@ dodospart: | |||
394 | } | 394 | } | |
395 | bp->b_oflags &= ~(BO_DONE); | 395 | bp->b_oflags &= ~(BO_DONE); | |
396 | bp->b_flags &= ~(B_READ); | 396 | bp->b_flags &= ~(B_READ); | |
397 | bp->b_flags |= B_WRITE; | 397 | bp->b_flags |= B_WRITE; | |
398 | (*strat)(bp); | 398 | (*strat)(bp); | |
399 | error = biowait(bp); | 399 | error = biowait(bp); | |
400 | } | 400 | } | |
401 | } | 401 | } | |
402 | 402 | |||
403 | #ifdef maybe | 403 | #ifdef maybe | |
404 | /* disklabel in appropriate location? */ | 404 | /* disklabel in appropriate location? */ | |
405 | if (lp->d_partitions[0].p_offset != 0 | 405 | if (lp->d_partitions[0].p_offset != 0 | |
406 | && lp->d_partitions[0].p_offset != dospartoff) { | 406 | && lp->d_partitions[0].p_offset != dospartoff) { | |
407 | error = EXDEV; | 407 | error = EXDEV; | |
408 | goto done; | 408 | goto done; | |
409 | } | 409 | } | |
410 | #endif | 410 | #endif | |
411 | 411 | |||
412 | done: | 412 | done: | |
413 | brelse(bp, 0); | 413 | brelse(bp, 0); | |
414 | return (error); | 414 | return (error); | |
415 | } | 415 | } | |
416 | 416 | |||
417 | static void | 417 | static void | |
418 | parttbl_consistency_check(struct disklabel *lp, struct dos_partition *dp) | 418 | parttbl_consistency_check(struct disklabel *lp, struct dos_partition *dp) | |
419 | { | 419 | { | |
420 | int i, j; | 420 | int i, j; |
--- src/sys/arch/x68k/x68k/iodevice.h 2011/05/14 10:19:58 1.18
+++ src/sys/arch/x68k/x68k/iodevice.h 2024/01/07 07:58:35 1.19
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: iodevice.h,v 1.18 2011/05/14 10:19:58 tsutsui Exp $ */ | 1 | /* $NetBSD: iodevice.h,v 1.19 2024/01/07 07:58:35 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1993, 1994, 1995 Masaru Oki | 4 | * Copyright (c) 1993, 1994, 1995 Masaru Oki | |
5 | * All rights reserved. | 5 | * 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. | |
@@ -256,28 +256,28 @@ struct spc { | @@ -256,28 +256,28 @@ struct spc { | |||
256 | * Zilog scc. | 256 | * Zilog scc. | |
257 | */ | 257 | */ | |
258 | struct zschan { | 258 | struct zschan { | |
259 | unsigned char zc_xxx0; | 259 | unsigned char zc_xxx0; | |
260 | unsigned char zc_csr; /* control and status, and indirect access */ | 260 | unsigned char zc_csr; /* control and status, and indirect access */ | |
261 | unsigned char zc_xxx1; | 261 | unsigned char zc_xxx1; | |
262 | unsigned char zc_data; /* data */ | 262 | unsigned char zc_data; /* data */ | |
263 | }; | 263 | }; | |
264 | 264 | |||
265 | struct zsdevice { | 265 | struct zsdevice { | |
266 | /* Yes, they are backwards. */ | 266 | /* Yes, they are backwards. */ | |
267 | struct zschan zs_chan_b; | 267 | struct zschan zs_chan_b; | |
268 | struct zschan zs_chan_a; | 268 | struct zschan zs_chan_a; | |
269 | char pad4; unsigned char bstat; /* external only : 2 bytes */ | 269 | char pad4; unsigned char bstat; /* external only : 2 bytes */ | |
270 | char pad[6]; /* --- : 6 bytes */ | 270 | char pad[6]; /* --- : 6 bytes */ | |
271 | }; | 271 | }; | |
272 | 272 | |||
273 | struct ppi8255 { | 273 | struct ppi8255 { | |
274 | char pad0; unsigned char porta; | 274 | char pad0; unsigned char porta; | |
275 | char pad1; unsigned char portb; | 275 | char pad1; unsigned char portb; | |
276 | char pad2; unsigned char portc; | 276 | char pad2; unsigned char portc; | |
277 | char pad3; unsigned char ctrl; | 277 | char pad3; unsigned char ctrl; | |
278 | char pad[0x1ff8]; | 278 | char pad[0x1ff8]; | |
279 | }; | 279 | }; | |
280 | 280 | |||
281 | struct ioctlr { | 281 | struct ioctlr { | |
282 | char pad0; unsigned char intr; | 282 | char pad0; unsigned char intr; | |
283 | char pad1; unsigned char vect; | 283 | char pad1; unsigned char vect; |
--- src/sys/arch/x68k/x68k/vectors.s 2014/03/14 20:24:24 1.18
+++ src/sys/arch/x68k/x68k/vectors.s 2024/01/07 07:58:35 1.19
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | | $NetBSD: vectors.s,v 1.18 2014/03/14 20:24:24 tsutsui Exp $ | 1 | | $NetBSD: vectors.s,v 1.19 2024/01/07 07:58:35 isaki Exp $ | |
2 | 2 | |||
3 | | Copyright (c) 1988 University of Utah | 3 | | Copyright (c) 1988 University of Utah | |
4 | | Copyright (c) 1990, 1993 | 4 | | Copyright (c) 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. | |
@@ -65,27 +65,27 @@ GLOBAL(vectab) | @@ -65,27 +65,27 @@ GLOBAL(vectab) | |||
65 | VECTOR(lev5intr) /* 29: level 5 interrupt autovector */ | 65 | VECTOR(lev5intr) /* 29: level 5 interrupt autovector */ | |
66 | VECTOR(lev6intr) /* 30: level 6 interrupt autovector */ | 66 | VECTOR(lev6intr) /* 30: level 6 interrupt autovector */ | |
67 | VECTOR(lev7intr) /* 31: level 7 interrupt autovector */ | 67 | VECTOR(lev7intr) /* 31: level 7 interrupt autovector */ | |
68 | VECTOR(trap0) /* 32: syscalls */ | 68 | VECTOR(trap0) /* 32: syscalls */ | |
69 | #ifdef COMPAT_13 | 69 | #ifdef COMPAT_13 | |
70 | VECTOR(trap1) /* 33: compat_13_sigreturn */ | 70 | VECTOR(trap1) /* 33: compat_13_sigreturn */ | |
71 | #else | 71 | #else | |
72 | VECTOR(illinst) | 72 | VECTOR(illinst) | |
73 | #endif | 73 | #endif | |
74 | VECTOR(trap2) /* 34: trace */ | 74 | VECTOR(trap2) /* 34: trace */ | |
75 | #ifdef COMPAT_16 | 75 | #ifdef COMPAT_16 | |
76 | VECTOR(trap3) /* 35: compat_16_sigreturn */ | 76 | VECTOR(trap3) /* 35: compat_16_sigreturn */ | |
77 | #else | 77 | #else | |
78 | VECTOR(illinst) | 78 | VECTOR(illinst) | |
79 | #endif | 79 | #endif | |
80 | VECTOR(illinst) /* 36: TRAP instruction vector */ | 80 | VECTOR(illinst) /* 36: TRAP instruction vector */ | |
81 | VECTOR(illinst) /* 37: TRAP instruction vector */ | 81 | VECTOR(illinst) /* 37: TRAP instruction vector */ | |
82 | VECTOR(illinst) /* 38: TRAP instruction vector */ | 82 | VECTOR(illinst) /* 38: TRAP instruction vector */ | |
83 | VECTOR(illinst) /* 39: TRAP instruction vector */ | 83 | VECTOR(illinst) /* 39: TRAP instruction vector */ | |
84 | VECTOR(illinst) /* 40: TRAP instruction vector */ | 84 | VECTOR(illinst) /* 40: TRAP instruction vector */ | |
85 | VECTOR(illinst) /* 41: TRAP instruction vector */ | 85 | VECTOR(illinst) /* 41: TRAP instruction vector */ | |
86 | VECTOR(illinst) /* 42: TRAP instruction vector */ | 86 | VECTOR(illinst) /* 42: TRAP instruction vector */ | |
87 | VECTOR(illinst) /* 43: TRAP instruction vector */ | 87 | VECTOR(illinst) /* 43: TRAP instruction vector */ | |
88 | VECTOR(trap12) /* 44: TRAP instruction vector */ | 88 | VECTOR(trap12) /* 44: TRAP instruction vector */ | |
89 | VECTOR(illinst) /* 45: TRAP instruction vector */ | 89 | VECTOR(illinst) /* 45: TRAP instruction vector */ | |
90 | VECTOR(illinst) /* 46: TRAP instruction vector */ | 90 | VECTOR(illinst) /* 46: TRAP instruction vector */ | |
91 | VECTOR(trap15) /* 47: TRAP instruction vector */ | 91 | VECTOR(trap15) /* 47: TRAP instruction vector */ |
--- src/sys/arch/x68k/x68k/kgdb_stub.c 2023/03/28 20:10:01 1.20
+++ src/sys/arch/x68k/x68k/kgdb_stub.c 2024/01/07 07:58:35 1.21
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kgdb_stub.c,v 1.20 2023/03/28 20:10:01 andvar Exp $ */ | 1 | /* $NetBSD: kgdb_stub.c,v 1.21 2024/01/07 07:58:35 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1990, 1993 | 4 | * Copyright (c) 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 software was developed by the Computer Systems Engineering group | 7 | * This software was developed by the Computer Systems Engineering group | |
8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | 8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | |
9 | * contributed to Berkeley. | 9 | * contributed to Berkeley. | |
10 | * | 10 | * | |
11 | * All advertising materials mentioning features or use of this software | 11 | * All advertising materials mentioning features or use of this software | |
12 | * must display the following acknowledgement: | 12 | * must display the following acknowledgement: | |
13 | * This product includes software developed by the University of | 13 | * This product includes software developed by the University of | |
14 | * California, Lawrence Berkeley Laboratories. | 14 | * California, Lawrence Berkeley Laboratories. | |
@@ -35,33 +35,33 @@ | @@ -35,33 +35,33 @@ | |||
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
38 | * SUCH DAMAGE. | 38 | * SUCH DAMAGE. | |
39 | * | 39 | * | |
40 | * @(#)kgdb_stub.c 8.4 (Berkeley) 1/12/94 | 40 | * @(#)kgdb_stub.c 8.4 (Berkeley) 1/12/94 | |
41 | */ | 41 | */ | |
42 | 42 | |||
43 | /* | 43 | /* | |
44 | * "Stub" to allow remote CPU to debug over a serial line using gdb. | 44 | * "Stub" to allow remote CPU to debug over a serial line using gdb. | |
45 | */ | 45 | */ | |
46 | 46 | |||
47 | #include <sys/cdefs.h> | 47 | #include <sys/cdefs.h> | |
48 | __KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.20 2023/03/28 20:10:01 andvar Exp $"); | 48 | __KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.21 2024/01/07 07:58:35 isaki Exp $"); | |
49 | 49 | |||
50 | #include "opt_kgdb.h" | 50 | #include "opt_kgdb.h" | |
51 | 51 | |||
52 | #ifdef KGDB | 52 | #ifdef KGDB | |
53 | #ifndef lint | 53 | #ifndef lint | |
54 | static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.20 2023/03/28 20:10:01 andvar Exp $"; | 54 | static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.21 2024/01/07 07:58:35 isaki Exp $"; | |
55 | #endif | 55 | #endif | |
56 | 56 | |||
57 | #include <sys/param.h> | 57 | #include <sys/param.h> | |
58 | #include <sys/systm.h> | 58 | #include <sys/systm.h> | |
59 | 59 | |||
60 | #include <machine/trap.h> | 60 | #include <machine/trap.h> | |
61 | #include <machine/cpu.h> | 61 | #include <machine/cpu.h> | |
62 | #include <machine/psl.h> | 62 | #include <machine/psl.h> | |
63 | #include <machine/reg.h> | 63 | #include <machine/reg.h> | |
64 | #include <machine/frame.h> | 64 | #include <machine/frame.h> | |
65 | 65 | |||
66 | #include <sys/buf.h> | 66 | #include <sys/buf.h> | |
67 | #include <dev/cons.h> | 67 | #include <dev/cons.h> | |
@@ -149,27 +149,27 @@ restart: | @@ -149,27 +149,27 @@ restart: | |||
149 | if (escape) | 149 | if (escape) | |
150 | c = FRAME_ESCAPE; | 150 | c = FRAME_ESCAPE; | |
151 | break; | 151 | break; | |
152 | 152 | |||
153 | case TRANS_FRAME_END: | 153 | case TRANS_FRAME_END: | |
154 | if (escape) | 154 | if (escape) | |
155 | c = FRAME_END; | 155 | c = FRAME_END; | |
156 | break; | 156 | break; | |
157 | 157 | |||
158 | case TRANS_FRAME_START: | 158 | case TRANS_FRAME_START: | |
159 | if (escape) | 159 | if (escape) | |
160 | c = FRAME_START; | 160 | c = FRAME_START; | |
161 | break; | 161 | break; | |
162 | 162 | |||
163 | case FRAME_START: | 163 | case FRAME_START: | |
164 | goto restart; | 164 | goto restart; | |
165 | 165 | |||
166 | case FRAME_END: | 166 | case FRAME_END: | |
167 | if (type < 0 || --len < 0) { | 167 | if (type < 0 || --len < 0) { | |
168 | csum = len = escape = 0; | 168 | csum = len = escape = 0; | |
169 | type = -1; | 169 | type = -1; | |
170 | continue; | 170 | continue; | |
171 | } | 171 | } | |
172 | if (csum != 0) { | 172 | if (csum != 0) { | |
173 | return (0); | 173 | return (0); | |
174 | } | 174 | } | |
175 | *lenp = len; | 175 | *lenp = len; | |
@@ -328,31 +328,32 @@ kgdb_trap(int type, struct frame *frame) | @@ -328,31 +328,32 @@ kgdb_trap(int type, struct frame *frame) | |||
328 | int inlen; | 328 | int inlen; | |
329 | u_long gdb_regs[NUM_REGS]; | 329 | u_long gdb_regs[NUM_REGS]; | |
330 | 330 | |||
331 | if ((int)kgdb_dev < 0) { | 331 | if ((int)kgdb_dev < 0) { | |
332 | /* not debugging */ | 332 | /* not debugging */ | |
333 | return (0); | 333 | return (0); | |
334 | } | 334 | } | |
335 | if (kgdb_active == 0) { | 335 | if (kgdb_active == 0) { | |
336 | if (type != T_TRAP15) { | 336 | if (type != T_TRAP15) { | |
337 | /* No debugger active -- let trap handle this. */ | 337 | /* No debugger active -- let trap handle this. */ | |
338 | return (0); | 338 | return (0); | |
339 | } | 339 | } | |
340 | kgdb_getc = 0; | 340 | kgdb_getc = 0; | |
341 | for (inlen = 0; constab[inlen].cn_probe; inlen++) | 341 | for (inlen = 0; constab[inlen].cn_probe; inlen++) { | |
342 | if (major(constab[inlen].cn_dev) == major(kgdb_dev)) { | 342 | if (major(constab[inlen].cn_dev) == major(kgdb_dev)) { | |
343 | kgdb_getc = constab[inlen].cn_getc; | 343 | kgdb_getc = constab[inlen].cn_getc; | |
344 | kgdb_putc = constab[inlen].cn_putc; | 344 | kgdb_putc = constab[inlen].cn_putc; | |
345 | break; | 345 | break; | |
346 | } | |||
346 | } | 347 | } | |
347 | if (kgdb_getc == 0 || kgdb_putc == 0) | 348 | if (kgdb_getc == 0 || kgdb_putc == 0) | |
348 | return (0); | 349 | return (0); | |
349 | /* | 350 | /* | |
350 | * If the packet that woke us up isn't an exec packet, | 351 | * If the packet that woke us up isn't an exec packet, | |
351 | * ignore it since there is no active debugger. Also, | 352 | * ignore it since there is no active debugger. Also, | |
352 | * we check that it's not an ack to be sure that the | 353 | * we check that it's not an ack to be sure that the | |
353 | * remote side doesn't send back a response after the | 354 | * remote side doesn't send back a response after the | |
354 | * local gdb has exited. Otherwise, the local host | 355 | * local gdb has exited. Otherwise, the local host | |
355 | * could trap into gdb if it's running a gdb kernel too. | 356 | * could trap into gdb if it's running a gdb kernel too. | |
356 | */ | 357 | */ | |
357 | in = GETC; | 358 | in = GETC; | |
358 | /* | 359 | /* | |
@@ -433,41 +434,41 @@ kgdb_trap(int type, struct frame *frame) | @@ -433,41 +434,41 @@ kgdb_trap(int type, struct frame *frame) | |||
433 | (in & KGDB_DELTA) == 0) { | 434 | (in & KGDB_DELTA) == 0) { | |
434 | if (outlen + 5 > SL_MAXDATA) { | 435 | if (outlen + 5 > SL_MAXDATA) { | |
435 | out |= KGDB_MORE; | 436 | out |= KGDB_MORE; | |
436 | break; | 437 | break; | |
437 | } | 438 | } | |
438 | cp[outlen] = len; | 439 | cp[outlen] = len; | |
439 | kgdb_copy((u_char *)&gdb_regs[len], | 440 | kgdb_copy((u_char *)&gdb_regs[len], | |
440 | &cp[outlen + 1], 4); | 441 | &cp[outlen + 1], 4); | |
441 | reg_cache[len] = gdb_regs[len]; | 442 | reg_cache[len] = gdb_regs[len]; | |
442 | outlen += 5; | 443 | outlen += 5; | |
443 | } | 444 | } | |
444 | } | 445 | } | |
445 | break; | 446 | break; | |
446 | 447 | |||
447 | case KGDB_REG_W: | 448 | case KGDB_REG_W: | |
448 | case KGDB_REG_W | KGDB_DELTA: | 449 | case KGDB_REG_W | KGDB_DELTA: | |
449 | cp = inbuffer; | 450 | cp = inbuffer; | |
450 | for (len = 0; len < inlen; len += 5) { | 451 | for (len = 0; len < inlen; len += 5) { | |
451 | int j = cp[len]; | 452 | int j = cp[len]; | |
452 | 453 | |||
453 | kgdb_copy(&cp[len + 1], | 454 | kgdb_copy(&cp[len + 1], | |
454 | (u_char *)&gdb_regs[j], 4); | 455 | (u_char *)&gdb_regs[j], 4); | |
455 | reg_cache[j] = gdb_regs[j]; | 456 | reg_cache[j] = gdb_regs[j]; | |
456 | } | 457 | } | |
457 | gdb_to_regs(frame, gdb_regs); | 458 | gdb_to_regs(frame, gdb_regs); | |
458 | outlen = 0; | 459 | outlen = 0; | |
459 | break; | 460 | break; | |
460 | 461 | |||
461 | case KGDB_MEM_R: | 462 | case KGDB_MEM_R: | |
462 | len = inbuffer[0]; | 463 | len = inbuffer[0]; | |
463 | kgdb_copy(&inbuffer[1], (u_char *)&addr, 4); | 464 | kgdb_copy(&inbuffer[1], (u_char *)&addr, 4); | |
464 | if (len > SL_MAXDATA) { | 465 | if (len > SL_MAXDATA) { | |
465 | outlen = 1; | 466 | outlen = 1; | |
466 | outbuffer[0] = E2BIG; | 467 | outbuffer[0] = E2BIG; | |
467 | } else if (!kgdb_acc(addr, len, B_READ)) { | 468 | } else if (!kgdb_acc(addr, len, B_READ)) { | |
468 | outlen = 1; | 469 | outlen = 1; | |
469 | outbuffer[0] = EFAULT; | 470 | outbuffer[0] = EFAULT; | |
470 | } else { | 471 | } else { | |
471 | outlen = len + 1; | 472 | outlen = len + 1; | |
472 | outbuffer[0] = 0; | 473 | outbuffer[0] = 0; | |
473 | kgdb_copy(addr, &outbuffer[1], len); | 474 | kgdb_copy(addr, &outbuffer[1], len); |
--- src/sys/arch/x68k/x68k/trap.c 2023/10/05 19:41:06 1.112
+++ src/sys/arch/x68k/x68k/trap.c 2024/01/07 07:58:35 1.113
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: trap.c,v 1.112 2023/10/05 19:41:06 ad Exp $ */ | 1 | /* $NetBSD: trap.c,v 1.113 2024/01/07 07:58:35 isaki Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988 University of Utah. | 4 | * Copyright (c) 1988 University of Utah. | |
5 | * Copyright (c) 1982, 1986, 1990, 1993 | 5 | * Copyright (c) 1982, 1986, 1990, 1993 | |
6 | * The Regents of the University of California. All rights reserved. | 6 | * The Regents of the University of California. All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department. | 10 | * Science Department. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -29,27 +29,27 @@ | @@ -29,27 +29,27 @@ | |||
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | * SUCH DAMAGE. | 34 | * SUCH DAMAGE. | |
35 | * | 35 | * | |
36 | * from: Utah $Hdr: trap.c 1.37 92/12/20$ | 36 | * from: Utah $Hdr: trap.c 1.37 92/12/20$ | |
37 | * | 37 | * | |
38 | * @(#)trap.c 8.5 (Berkeley) 1/4/94 | 38 | * @(#)trap.c 8.5 (Berkeley) 1/4/94 | |
39 | */ | 39 | */ | |
40 | 40 | |||
41 | #include <sys/cdefs.h> | 41 | #include <sys/cdefs.h> | |
42 | __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.112 2023/10/05 19:41:06 ad Exp $"); | 42 | __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.113 2024/01/07 07:58:35 isaki Exp $"); | |
43 | 43 | |||
44 | #include "opt_ddb.h" | 44 | #include "opt_ddb.h" | |
45 | #include "opt_kgdb.h" | 45 | #include "opt_kgdb.h" | |
46 | #include "opt_execfmt.h" | 46 | #include "opt_execfmt.h" | |
47 | #include "opt_compat_sunos.h" | 47 | #include "opt_compat_sunos.h" | |
48 | #include "opt_fpu_emulate.h" | 48 | #include "opt_fpu_emulate.h" | |
49 | #include "opt_m68k_arch.h" | 49 | #include "opt_m68k_arch.h" | |
50 | 50 | |||
51 | #include <sys/param.h> | 51 | #include <sys/param.h> | |
52 | #include <sys/systm.h> | 52 | #include <sys/systm.h> | |
53 | #include <sys/proc.h> | 53 | #include <sys/proc.h> | |
54 | #include <sys/acct.h> | 54 | #include <sys/acct.h> | |
55 | #include <sys/kernel.h> | 55 | #include <sys/kernel.h> | |
@@ -534,28 +534,28 @@ trap(struct frame *fp, int type, unsigne | @@ -534,28 +534,28 @@ trap(struct frame *fp, int type, unsigne | |||
534 | struct vm_map *map; | 534 | struct vm_map *map; | |
535 | vm_prot_t ftype; | 535 | vm_prot_t ftype; | |
536 | extern struct vm_map *kernel_map; | 536 | extern struct vm_map *kernel_map; | |
537 | 537 | |||
538 | onfault = pcb->pcb_onfault; | 538 | onfault = pcb->pcb_onfault; | |
539 | 539 | |||
540 | #ifdef DEBUG | 540 | #ifdef DEBUG | |
541 | if ((mmudebug & MDB_WBFOLLOW) || MDB_ISPID(p->p_pid)) | 541 | if ((mmudebug & MDB_WBFOLLOW) || MDB_ISPID(p->p_pid)) | |
542 | printf("trap: T_MMUFLT pid=%d, code=%x, v=%x, pc=%x, sr=%x\n", | 542 | printf("trap: T_MMUFLT pid=%d, code=%x, v=%x, pc=%x, sr=%x\n", | |
543 | p->p_pid, code, v, fp->f_pc, fp->f_sr); | 543 | p->p_pid, code, v, fp->f_pc, fp->f_sr); | |
544 | #endif | 544 | #endif | |
545 | /* | 545 | /* | |
546 | * It is only a kernel address space fault iff: | 546 | * It is only a kernel address space fault iff: | |
547 | * 1. (type & T_USER) == 0 and | 547 | * 1. (type & T_USER) == 0 and | |
548 | * 2. pcb_onfault not set or | 548 | * 2. pcb_onfault not set or | |
549 | * 3. pcb_onfault set but supervisor space data fault | 549 | * 3. pcb_onfault set but supervisor space data fault | |
550 | * The last can occur during an exec() copyin where the | 550 | * The last can occur during an exec() copyin where the | |
551 | * argument space is lazy-allocated. | 551 | * argument space is lazy-allocated. | |
552 | */ | 552 | */ | |
553 | if ((type & T_USER) == 0 && (onfault == NULL || KDFAULT(code))) | 553 | if ((type & T_USER) == 0 && (onfault == NULL || KDFAULT(code))) | |
554 | map = kernel_map; | 554 | map = kernel_map; | |
555 | else { | 555 | else { | |
556 | map = vm ? &vm->vm_map : kernel_map; | 556 | map = vm ? &vm->vm_map : kernel_map; | |
557 | } | 557 | } | |
558 | 558 | |||
559 | if (WRFAULT(code)) | 559 | if (WRFAULT(code)) | |
560 | ftype = VM_PROT_WRITE; | 560 | ftype = VM_PROT_WRITE; | |
561 | else | 561 | else |