swim: Unexport global symbols

These symbols aren't used outside of this file so use local ones.
No functional change.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/0810de0df2a670d4d9ccad4e747be2c4b46f6d6e.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Finn Thain 2026-09-04 19:26:36 +10:00 committed by Jens Axboe
parent 75f47f0910
commit e7a6727dea

View File

@ -14,33 +14,33 @@
* 2008-11-05 (lv) - add get_swim_mode
*/
.equ write_data, 0x0000
.equ write_mark, 0x0200
.equ write_CRC, 0x0400
.equ write_parameter,0x0600
.equ write_phase, 0x0800
.equ write_setup, 0x0a00
.equ write_mode0, 0x0c00
.equ write_mode1, 0x0e00
.equ read_data, 0x1000
.equ read_mark, 0x1200
.equ read_error, 0x1400
.equ read_parameter, 0x1600
.equ read_phase, 0x1800
.equ read_setup, 0x1a00
.equ read_status, 0x1c00
.equ read_handshake, 0x1e00
.equ .Lwrite_data, 0x0000
.equ .Lwrite_mark, 0x0200
.equ .Lwrite_CRC, 0x0400
.equ .Lwrite_parameter, 0x0600
.equ .Lwrite_phase, 0x0800
.equ .Lwrite_setup, 0x0a00
.equ .Lwrite_mode0, 0x0c00
.equ .Lwrite_mode1, 0x0e00
.equ .Lread_data, 0x1000
.equ .Lread_mark, 0x1200
.equ .Lread_error, 0x1400
.equ .Lread_parameter, 0x1600
.equ .Lread_phase, 0x1800
.equ .Lread_setup, 0x1a00
.equ .Lread_status, 0x1c00
.equ .Lread_handshake, 0x1e00
.equ o_side, 0
.equ o_track, 1
.equ o_sector, 2
.equ o_size, 3
.equ o_crc0, 4
.equ o_crc1, 5
.equ .Lo_side, 0
.equ .Lo_track, 1
.equ .Lo_sector, 2
.equ .Lo_size, 3
.equ .Lo_crc0, 4
.equ .Lo_crc1, 5
.equ seek_time, 30000
.equ max_retry, 40
.equ sector_size, 512
.equ .Lseek_time, 30000
.equ .Lmax_retry, 40
.equ .Lsector_size, 512
.equ .Lmark_sequence_len, 4
.equ .Lmr_clear_fifo, 0x01
@ -63,7 +63,7 @@
moveq #-1, %d1
subq #1, %d4
movew #seek_time, %d2
movew #.Lseek_time, %d2
5: tstb %a2@
dbmi %d2, 5b
@ -88,80 +88,86 @@ swim_read_sector_header:
unlk %a6
rts
sector_address_mark:
.Lsector_address_mark:
.byte 0xa1, 0xa1, 0xa1, 0xfe
sector_data_mark:
.Lsector_data_mark:
.byte 0xa1, 0xa1, 0xa1, 0xfb
.Lmfm_read_header:
movel %a6@(0x08), %a3
lea %a3@(read_handshake), %a2
lea %a3@(read_data), %a5
lea %a3@(read_mark), %a3
lea %a3@(.Lread_handshake), %a2
lea %a3@(.Lread_data), %a5
lea %a3@(.Lread_mark), %a3
moveb #.Lmr_write_action, %a3@(write_mode0 - read_mark)
moveb #.Lmr_clear_fifo, %a3@(write_mode1 - read_mark)
moveb #.Lmr_clear_fifo, %a3@(write_mode0 - read_mark)
tstb %a3@(read_error - read_mark)
moveb #.Lmr_action, %a3@(write_mode1 - read_mark)
moveb #.Lmr_write_action, %a3@(.Lwrite_mode0 - .Lread_mark)
moveb #.Lmr_clear_fifo, %a3@(.Lwrite_mode1 - .Lread_mark)
moveb #.Lmr_clear_fifo, %a3@(.Lwrite_mode0 - .Lread_mark)
tstb %a3@(.Lread_error - .Lread_mark)
moveb #.Lmr_action, %a3@(.Lwrite_mode1 - .Lread_mark)
lea sector_address_mark, %a1
lea .Lsector_address_mark, %a1
moveq #.Lmark_sequence_len, %d4
bsr .Lmfm_mark_check
tstl %d1
bne signal_nonyb
bne .Lsignal_nonyb
/* read header */
moveq #max_retry, %d2
amark0: tstb %a2@
dbmi %d2, amark0
bpl signal_nonyb
moveq #.Lmax_retry, %d2
.Lamark0:
tstb %a2@
dbmi %d2, .Lamark0
bpl .Lsignal_nonyb
moveb %a5@, %a4@(o_track)
moveb %a5@, %a4@(.Lo_track)
moveq #max_retry, %d2
amark1: tstb %a2@
dbmi %d2, amark1
bpl signal_nonyb
moveq #.Lmax_retry, %d2
.Lamark1:
tstb %a2@
dbmi %d2, .Lamark1
bpl .Lsignal_nonyb
moveb %a5@, %a4@(o_side)
moveb %a5@, %a4@(.Lo_side)
moveq #max_retry, %d2
amark2: tstb %a2@
dbmi %d2, amark2
bpl signal_nonyb
moveq #.Lmax_retry, %d2
.Lamark2:
tstb %a2@
dbmi %d2, .Lamark2
bpl .Lsignal_nonyb
moveb %a5@, %a4@(o_sector)
moveb %a5@, %a4@(.Lo_sector)
moveq #max_retry, %d2
amark3: tstb %a2@
dbmi %d2, amark3
bpl signal_nonyb
moveq #.Lmax_retry, %d2
.Lamark3:
tstb %a2@
dbmi %d2, .Lamark3
bpl .Lsignal_nonyb
moveb %a5@, %a4@(o_size)
moveb %a5@, %a4@(.Lo_size)
moveq #max_retry, %d2
crc0: tstb %a2@
dbmi %d2, crc0
bpl signal_nonyb
moveq #.Lmax_retry, %d2
.Lcrc0:
tstb %a2@
dbmi %d2, .Lcrc0
bpl .Lsignal_nonyb
moveb %a5@, %a4@(o_crc0)
moveb %a5@, %a4@(.Lo_crc0)
moveq #max_retry, %d2
crc1: tstb %a2@
dbmi %d2, crc1
bpl signal_nonyb
moveq #.Lmax_retry, %d2
.Lcrc1:
tstb %a2@
dbmi %d2, .Lcrc1
bpl .Lsignal_nonyb
moveb %a5@, %a4@(o_crc1)
moveb %a5@, %a4@(.Lo_crc1)
moveb %a2@, %d5
andb #.Lhr_crc_error, %d5
bne signal_nonyb
bne .Lsignal_nonyb
moveq #0, %d0
signal_nonyb:
moveb #.Lmr_write_action, %a3@(write_mode0 - read_mark)
.Lsignal_nonyb:
moveb #.Lmr_write_action, %a3@(.Lwrite_mode0 - .Lread_mark)
rts
.global swim_read_sector_data
@ -170,80 +176,80 @@ swim_read_sector_data:
moveml %d1-%d5/%a0-%a5,%sp@-
movel %a6@(0x0c), %a4
moveq #-1, %d0
bsr mfm_read_data
bsr .Lmfm_read_data
moveml %sp@+, %d1-%d5/%a0-%a5
unlk %a6
rts
mfm_read_data:
.Lmfm_read_data:
movel %a6@(0x08), %a3
lea %a3@(read_handshake), %a2
lea %a3@(read_data), %a5
lea %a3@(read_mark), %a3
lea %a3@(.Lread_handshake), %a2
lea %a3@(.Lread_data), %a5
lea %a3@(.Lread_mark), %a3
moveb #.Lmr_write_action, %a3@(write_mode0 - read_mark)
moveb #.Lmr_clear_fifo, %a3@(write_mode1 - read_mark)
moveb #.Lmr_clear_fifo, %a3@(write_mode0 - read_mark)
tstb %a3@(read_error - read_mark)
moveb #.Lmr_action, %a3@(write_mode1 - read_mark)
moveb #.Lmr_write_action, %a3@(.Lwrite_mode0 - .Lread_mark)
moveb #.Lmr_clear_fifo, %a3@(.Lwrite_mode1 - .Lread_mark)
moveb #.Lmr_clear_fifo, %a3@(.Lwrite_mode0 - .Lread_mark)
tstb %a3@(.Lread_error - .Lread_mark)
moveb #.Lmr_action, %a3@(.Lwrite_mode1 - .Lread_mark)
lea sector_data_mark, %a1
lea .Lsector_data_mark, %a1
moveq #.Lmark_sequence_len, %d4
bsr .Lmfm_mark_check
tstl %d1
bne data_exit
bne .Ldata_exit
/* read data */
movel #sector_size - 1, %d4 /* sector size */
movew #max_retry, %d2
read_data_loop:
movel #.Lsector_size - 1, %d4 /* sector size */
movew #.Lmax_retry, %d2
.Lread_data_loop:
moveb %a2@, %d5
andb #(.Lhr_fifo_1byte + .Lhr_fifo_2bytes), %d5
dbne %d2, read_data_loop
beq data_exit
dbne %d2, .Lread_data_loop
beq .Ldata_exit
moveq #max_retry, %d2
moveq #.Lmax_retry, %d2
moveb %a5@, %d3
bsr .Lmaybe_store
dbra %d4, 1f
bra data_crc0
bra .Ldata_crc0
1: andb #.Lhr_fifo_2bytes, %d5
beq read_data_loop
beq .Lread_data_loop
moveb %a5@, %d3
bsr .Lmaybe_store
dbra %d4, read_data_loop
dbra %d4, .Lread_data_loop
/* read CRC */
movew #max_retry, %d2
data_crc0:
movew #.Lmax_retry, %d2
.Ldata_crc0:
tstb %a2@
dbmi %d2, data_crc0
bpl data_exit
dbmi %d2, .Ldata_crc0
bpl .Ldata_exit
moveb %a5@, %d5
moveq #max_retry, %d2
data_crc1:
moveq #.Lmax_retry, %d2
.Ldata_crc1:
tstb %a2@
dbmi %d2, data_crc1
bpl data_exit
dbmi %d2, .Ldata_crc1
bpl .Ldata_exit
moveb %a5@, %d5
moveb %a2@, %d5
andb #.Lhr_crc_error, %d5
bne data_exit
bne .Ldata_exit
/* return number of bytes read */
movel #sector_size, %d0
movel #.Lsector_size, %d0
addw #1, %d4
subl %d4, %d0
data_exit:
moveb #.Lmr_write_action, %a3@(write_mode0 - read_mark)
.Ldata_exit:
moveb #.Lmr_write_action, %a3@(.Lwrite_mode0 - .Lread_mark)
rts
.Lmaybe_store: