#include <linux/linkage.h>
#include <linux/init.h>
#include <linux/pgtable.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo-amiga.h>
#include <asm/bootinfo-atari.h>
#include <asm/bootinfo-hp300.h>
#include <asm/bootinfo-mac.h>
#include <asm/bootinfo-q40.h>
#include <asm/bootinfo-virt.h>
#include <asm/bootinfo-vme.h>
#include <asm/setup.h>
#include <asm/entry.h>
#include <asm/page.h>
#include <asm/asm-offsets.h>
#ifdef CONFIG_MAC
# include <asm/machw.h>
#endif
#ifdef CONFIG_EARLY_PRINTK
# define SERIAL_DEBUG
# if defined(CONFIG_MAC) && defined(CONFIG_FONT_SUPPORT)
# define CONSOLE_DEBUG
# endif
#endif
#undef MMU_PRINT
#undef MMU_NOCACHE_KERNEL
#undef DEBUG
#define FONT_8x8
.globl kernel_pg_dir
.globl availmem
.globl m68k_init_mapped_size
.globl m68k_pgtable_cachemode
.globl m68k_supervisor_cachemode
#ifdef CONFIG_MVME16x
.globl mvme_bdid
#endif
#ifdef CONFIG_Q40
.globl q40_mem_cptr
#endif
CPUTYPE_040 = 1
CPUTYPE_060 = 2
CPUTYPE_0460 = 3
CPUTYPE_020 = 4
TC_ENABLE = 0x8000
TC_PAGE8K = 0x4000
TC_PAGE4K = 0x0000
TTR_ENABLE = 0x8000
TTR_ANYMODE = 0x4000
TTR_KERNELMODE = 0x2000
TTR_USERMODE = 0x0000
TTR_CI = 0x0400
TTR_RW = 0x0200
TTR_RWM = 0x0100
TTR_FCB2 = 0x0040
TTR_FCB1 = 0x0020
TTR_FCB0 = 0x0010
TTR_FCM2 = 0x0004
TTR_FCM1 = 0x0002
TTR_FCM0 = 0x0001
CC6_ENABLE_D = 0x80000000
CC6_FREEZE_D = 0x40000000
CC6_ENABLE_SB = 0x20000000
CC6_PUSH_DPI = 0x10000000
CC6_HALF_D = 0x08000000
CC6_ENABLE_B = 0x00800000
CC6_CLRA_B = 0x00400000
CC6_CLRU_B = 0x00200000
CC6_ENABLE_I = 0x00008000
CC6_FREEZE_I = 0x00004000
CC6_HALF_I = 0x00002000
CC3_ALLOC_WRITE = 0x00002000
CC3_ENABLE_DB = 0x00001000
CC3_CLR_D = 0x00000800
CC3_CLRE_D = 0x00000400
CC3_FREEZE_D = 0x00000200
CC3_ENABLE_D = 0x00000100
CC3_ENABLE_IB = 0x00000010
CC3_CLR_I = 0x00000008
CC3_CLRE_I = 0x00000004
CC3_FREEZE_I = 0x00000002
CC3_ENABLE_I = 0x00000001
PAGESIZE = 4096
PAGESHIFT = 12
ROOT_TABLE_SIZE = 128
PTR_TABLE_SIZE = 128
PAGE_TABLE_SIZE = 64
ROOT_INDEX_SHIFT = 25
PTR_INDEX_SHIFT = 18
PAGE_INDEX_SHIFT = 12
#ifdef DEBUG
#ifdef __STDC__
#define L(name) .head.S.##name
#else
#define L(name) .head.S.name
#endif
#else
#ifdef __STDC__
#define L(name) .L##name
#else
#define L(name) .Lname
#endif
#endif
#ifndef __INITDATA
#define __INITDATA .data
#define __FINIT .previous
#endif
#define STACK %a6@(stackstart)
#define ARG0 %a6@(4)
#define ARG1 %a6@(8)
#define ARG2 %a6@(12)
#define ARG3 %a6@(16)
#define ARG4 %a6@(20)
.macro func_start name,saveregs,stack=0
L(\name):
linkw %a6,#-\stack
moveml \saveregs,%sp@-
.set stackstart,-\stack
.macro func_return_\name
moveml %sp@+,\saveregs
unlk %a6
rts
.endm
.endm
.macro func_return name
func_return_\name
.endm
.macro func_call name
jbsr L(\name)
.endm
.macro move_stack nr,arg1,arg2,arg3,arg4
.if \nr
move_stack "(\nr-1)",\arg2,\arg3,\arg4
movel \arg1,%sp@-
.endif
.endm
.macro func_define name,nr=0
.macro \name arg1,arg2,arg3,arg4
move_stack \nr,\arg1,\arg2,\arg3,\arg4
func_call \name
.if \nr
lea %sp@(\nr*4),%sp
.endif
.endm
.endm
func_define mmu_map,4
func_define mmu_map_tt,4
func_define mmu_fixup_page_mmu_cache,1
func_define mmu_temp_map,2
func_define mmu_engage
func_define mmu_get_root_table_entry,1
func_define mmu_get_ptr_table_entry,2
func_define mmu_get_page_table_entry,2
func_define mmu_print
func_define get_new_page
#if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
func_define set_leds
#endif
.macro mmu_map_eq arg1,arg2,arg3
mmu_map \arg1,\arg1,\arg2,\arg3
.endm
.macro get_bi_record record
pea \record
func_call get_bi_record
addql #4,%sp
.endm
func_define serial_putc,1
func_define console_putc,1
func_define console_init
func_define console_put_penguin
func_define console_plot_pixel,3
func_define console_scroll
.macro putc ch
#if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG)
pea \ch
#endif
#ifdef CONSOLE_DEBUG
func_call console_putc
#endif
#ifdef SERIAL_DEBUG
func_call serial_putc
#endif
#if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG)
addql #4,%sp
#endif
.endm
.macro dputc ch
#ifdef DEBUG
putc \ch
#endif
.endm
func_define putn,1
.macro dputn nr
#ifdef DEBUG
putn \nr
#endif
.endm
.macro puts string
#if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG)
__INITDATA
.Lstr\@:
.string "\string"
__FINIT
pea %pc@(.Lstr\@)
func_call puts
addql #4,%sp
#endif
.endm
.macro dputs string
#ifdef DEBUG
puts "\string"
#endif
.endm
#define is_not_amiga(lab) cmpl &MACH_AMIGA,%pc@(m68k_machtype); jne lab
#define is_not_atari(lab) cmpl &MACH_ATARI,%pc@(m68k_machtype); jne lab
#define is_not_mac(lab) cmpl &MACH_MAC,%pc@(m68k_machtype); jne lab
#define is_not_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jne lab
#define is_not_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jne lab
#define is_not_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jne lab
#define is_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jeq lab
#define is_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jeq lab
#define is_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jeq lab
#define is_not_hp300(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); jne lab
#define is_not_apollo(lab) cmpl &MACH_APOLLO,%pc@(m68k_machtype); jne lab
#define is_not_q40(lab) cmpl &MACH_Q40,%pc@(m68k_machtype); jne lab
#define is_not_sun3x(lab) cmpl &MACH_SUN3X,%pc@(m68k_machtype); jne lab
#define is_not_virt(lab) cmpl &MACH_VIRT,%pc@(m68k_machtype); jne lab
#define hasnt_leds(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); \
jeq 42f; \
cmpl &MACH_APOLLO,%pc@(m68k_machtype); \
jne lab ;\
42:\
#define is_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jne lab
#define is_not_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jeq lab
#define is_040(lab) btst &CPUTYPE_040,%pc@(L(cputype)+3); jne lab
#define is_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jne lab
#define is_not_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jeq lab
#define is_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jne lab
#define is_not_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jeq lab
.macro leds mask
#if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
hasnt_leds(.Lled\@)
pea \mask
func_call set_leds
addql #4,%sp
.Lled\@:
#endif
.endm
__HEAD
ENTRY(_stext)
bras 1f
.long BOOTINFOV_MAGIC
.long MACH_AMIGA, AMIGA_BOOTI_VERSION
.long MACH_ATARI, ATARI_BOOTI_VERSION
.long MACH_MVME147, MVME147_BOOTI_VERSION
.long MACH_MVME16x, MVME16x_BOOTI_VERSION
.long MACH_BVME6000, BVME6000_BOOTI_VERSION
.long MACH_MAC, MAC_BOOTI_VERSION
.long MACH_Q40, Q40_BOOTI_VERSION
.long MACH_HP300, HP300_BOOTI_VERSION
.long 0
1: jra __start
.equ kernel_pg_dir,_stext
.equ .,_stext+PAGESIZE
ENTRY(_start)
jra __start
__INIT
ENTRY(__start)
lea %pc@(_stext),%sp
get_bi_record BI_MACHTYPE
lea %pc@(m68k_machtype),%a1
movel %a0@,%a1@
get_bi_record BI_FPUTYPE
lea %pc@(m68k_fputype),%a1
movel %a0@,%a1@
get_bi_record BI_MMUTYPE
lea %pc@(m68k_mmutype),%a1
movel %a0@,%a1@
get_bi_record BI_CPUTYPE
lea %pc@(m68k_cputype),%a1
movel %a0@,%a1@
leds 0x1
#ifdef CONFIG_MAC
is_not_mac(L(test_notmac))
get_bi_record BI_MAC_VADDR
lea %pc@(L(mac_videobase)),%a1
movel %a0@,%a1@
get_bi_record BI_MAC_VDEPTH
lea %pc@(L(mac_videodepth)),%a1
movel %a0@,%a1@
get_bi_record BI_MAC_VDIM
lea %pc@(L(mac_dimensions)),%a1
movel %a0@,%a1@
get_bi_record BI_MAC_VROW
lea %pc@(L(mac_rowbytes)),%a1
movel %a0@,%a1@
get_bi_record BI_MAC_SCCBASE
lea %pc@(L(mac_sccbase)),%a1
movel %a0@,%a1@
L(test_notmac):
#endif
#ifdef CONFIG_VIRT
is_not_virt(L(test_notvirt))
get_bi_record BI_VIRT_GF_TTY_BASE
lea %pc@(L(virt_gf_tty_base)),%a1
movel %a0@,%a1@
L(test_notvirt):
#endif
movel %pc@(m68k_cputype),%d0
clrl %d1
btst #CPUB_68060,%d0
jeq 1f
bset #CPUTYPE_060,%d1
bset #CPUTYPE_0460,%d1
jra 3f
1:
btst #CPUB_68040,%d0
jeq 2f
bset #CPUTYPE_040,%d1
bset #CPUTYPE_0460,%d1
jra 3f
2:
btst #CPUB_68020,%d0
jeq 3f
bset #CPUTYPE_020,%d1
jra 3f
3:
lea %pc@(L(cputype)),%a0
movel %d1,%a0@
clrl %d0
clrl %d1
is_not_040_or_060(L(save_cachetype))
#ifdef CONFIG_060_WRITETHROUGH
is_not_060(1f)
movel #_PAGE_CACHE040W,%d0
jra L(save_cachetype)
#endif
1:
movew #_PAGE_CACHE040,%d0
movel #_PAGE_CACHE040W,%d1
L(save_cachetype):
lea %pc@(m68k_supervisor_cachemode),%a0
movel %d0,%a0@
lea %pc@(m68k_pgtable_cachemode),%a0
movel %d1,%a0@
movew #0x2700,%sr
#ifdef CONFIG_ATARI
is_not_atari(L(notypetest))
moveq #0,%d3
get_bi_record BI_ATARI_MCH_TYPE
tstl %d0
jbmi 1f
movel %a0@,%d3
lea %pc@(atari_mch_type),%a0
movel %d3,%a0@
1:
moveq #0,%d0
cmpl #ATARI_MACH_HADES,%d3
jbne 1f
movel #0xff000000,%d0
1: lea %pc@(L(iobase)),%a0
movel %d0,%a0@
L(notypetest):
#endif
#ifdef CONFIG_VME
is_mvme147(L(getvmetype))
is_bvme6000(L(getvmetype))
is_not_mvme16x(L(gvtdone))
L(getvmetype):
get_bi_record BI_VME_TYPE
tstl %d0
jbmi 1f
movel %a0@,%d3
lea %pc@(vme_brdtype),%a0
movel %d3,%a0@
1:
#ifdef CONFIG_MVME16x
is_not_mvme16x(L(gvtdone))
get_bi_record BI_VME_BRDINFO
tstl %d0
jpl 1f
movel %d2,%sp@-
trap #15
.word 0x70
movel %sp@+,%a0
1:
lea %pc@(mvme_bdid),%a1
movel %a0@+,%a1@+
movel %a0@+,%a1@+
movel %a0@+,%a1@+
movel %a0@+,%a1@+
movel %a0@+,%a1@+
movel %a0@+,%a1@+
movel %a0@+,%a1@+
movel %a0@+,%a1@+
#endif
L(gvtdone):
#endif
#ifdef CONFIG_HP300
is_not_hp300(L(nothp))
get_bi_record BI_HP300_UART_ADDR
tstl %d0
jbmi 1f
movel %a0@,%d3
lea %pc@(L(uartbase)),%a0
movel %d3,%a0@
get_bi_record BI_HP300_UART_SCODE
tstl %d0
jbmi 1f
movel %a0@,%d3
lea %pc@(L(uart_scode)),%a0
movel %d3,%a0@
1:
L(nothp):
#endif
jbsr L(serial_init)
#ifdef CONFIG_MAC
is_not_mac(L(nocon))
# ifdef CONSOLE_DEBUG
console_init
# ifdef CONFIG_LOGO
console_put_penguin
# endif
# endif
L(nocon):
#endif
putc '\n'
putc 'A'
leds 0x2
dputn %pc@(L(cputype))
dputn %pc@(m68k_supervisor_cachemode)
dputn %pc@(m68k_pgtable_cachemode)
dputc '\n'
lea %pc@(L(phys_kernel_start)),%a0
lea %pc@(_stext),%a1
subl #_stext,%a1
addl #PAGE_OFFSET,%a1
movel %a1,%a0@
putc 'B'
leds 0x4
get_bi_record BI_MEMCHUNK
movel %a0@(4),%d0
movel #16*1024*1024,%d1
cmpl %d0,%d1
jls 1f
lsrl #1,%d1
cmpl %d0,%d1
jls 1f
lsrl #1,%d1
1:
lea %pc@(m68k_init_mapped_size),%a0
movel %d1,%a0@
mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\
%pc@(m68k_supervisor_cachemode)
putc 'C'
#ifdef CONFIG_AMIGA
L(mmu_init_amiga):
is_not_amiga(L(mmu_init_not_amiga))
putc 'D'
is_not_040_or_060(1f)
mmu_map #0x80000000,#0,#0x01000000,#_PAGE_NOCACHE_S
mmu_map_tt #1,#0x40000000,#0x20000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
1:
mmu_map #0x80000000,#0,#0x02000000,#_PAGE_NOCACHE030
mmu_map_tt #1,#0x40000000,#0x20000000,#_PAGE_NOCACHE030
jbra L(mmu_init_done)
L(mmu_init_not_amiga):
#endif
#ifdef CONFIG_ATARI
L(mmu_init_atari):
is_not_atari(L(mmu_init_not_atari))
putc 'E'
moveq #0,%d0
movel %pc@(atari_mch_type),%d3
cmpl #ATARI_MACH_MEDUSA,%d3
jbeq 2f
cmpl #ATARI_MACH_HADES,%d3
jbne 1f
2: movel #0xff000000,%d0
1: movel %d0,%d3
is_040_or_060(L(spata68040))
mmu_map #0xff000000,%d3,#0x01000000,#_PAGE_NOCACHE030
jbra L(mmu_init_done)
L(spata68040):
mmu_map #0xff000000,%d3,#0x01000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(mmu_init_not_atari):
#endif
#ifdef CONFIG_Q40
is_not_q40(L(notq40))
putc 'Q'
mmu_map_tt #0,#0xfe000000,#0x01000000,#_PAGE_CACHE040W
mmu_map_tt #1,#0xff000000,#0x01000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(notq40):
#endif
#ifdef CONFIG_HP300
is_not_hp300(L(nothp300))
is_040(1f)
mmu_map #0xf0000000,#0,#0x02000000,#_PAGE_NOCACHE030
jbra L(mmu_init_done)
1:
mmu_map #0xf0000000,#0,#0x01000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(nothp300):
#endif
#ifdef CONFIG_MVME147
is_not_mvme147(L(not147))
mmu_map_tt #1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE030
jbra L(mmu_init_done)
L(not147):
#endif
#ifdef CONFIG_MVME16x
is_not_mvme16x(L(not16x))
mmu_map_tt #1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(not16x):
#endif
#ifdef CONFIG_BVME6000
is_not_bvme6000(L(not6000))
mmu_map_tt #1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(not6000):
#endif
#ifdef CONFIG_MAC
L(mmu_init_mac):
is_not_mac(L(mmu_init_not_mac))
putc 'F'
is_not_040_or_060(1f)
moveq #_PAGE_NOCACHE_S,%d3
jbra 2f
1:
moveq #_PAGE_NOCACHE030,%d3
2:
movel #VIDEOMEMMASK,%d0
andl %pc@(L(mac_videobase)),%d0
mmu_map #VIDEOMEMBASE,%d0,#VIDEOMEMSIZE,%d3
mmu_map_eq #0x40000000,#0x02000000,%d3
mmu_map_eq #0x50000000,#0x03000000,%d3
mmu_map_tt #1,#0xf8000000,#0x08000000,%d3
jbra L(mmu_init_done)
L(mmu_init_not_mac):
#endif
#ifdef CONFIG_SUN3X
is_not_sun3x(L(notsun3x))
movel #0xfee00000, %d0
moveq #ROOT_INDEX_SHIFT, %d1
lsrl %d1,%d0
mmu_get_root_table_entry %d0
movel #0xfee00000, %d0
moveq #PTR_INDEX_SHIFT, %d1
lsrl %d1,%d0
andl #PTR_TABLE_SIZE-1, %d0
mmu_get_ptr_table_entry %a0,%d0
movel #0xfee00000, %d0
moveq #PAGE_INDEX_SHIFT, %d1
lsrl %d1,%d0
andl #PAGE_TABLE_SIZE-1, %d0
mmu_get_page_table_entry %a0,%d0
movel 0xfefe00d4, %a1
movel %a1@, %a1
movel #((0x200000 >> 13)-1), %d1
1:
movel %a1@+, %d3
movel %d3,%a0@+
addl #0x1000,%d3
movel %d3,%a0@+
dbra %d1,1b
mmu_map_tt #1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(notsun3x):
#endif
#ifdef CONFIG_VIRT
is_not_virt(L(novirt))
mmu_map_tt #1,#0xFF000000,#0x01000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(novirt):
#endif
#ifdef CONFIG_APOLLO
is_not_apollo(L(notapollo))
putc 'P'
mmu_map #0x80000000,#0,#0x02000000,#_PAGE_NOCACHE030
L(notapollo):
jbra L(mmu_init_done)
#endif
L(mmu_init_done):
putc 'G'
leds 0x8
L(mmu_fixup):
is_not_040_or_060(L(mmu_fixup_done))
#ifdef MMU_NOCACHE_KERNEL
jbra L(mmu_fixup_done)
#endif
movel %pc@(L(phys_kernel_start)),%d0
subl #PAGE_OFFSET,%d0
lea %pc@(_stext),%a0
subl %d0,%a0
mmu_fixup_page_mmu_cache %a0
movel %pc@(L(kernel_end)),%a0
subl %d0,%a0
movel %pc@(L(memory_start)),%a1
subl %d0,%a1
bra 2f
1:
mmu_fixup_page_mmu_cache %a0
addw #PAGESIZE,%a0
2:
cmpl %a0,%a1
jgt 1b
L(mmu_fixup_done):
#ifdef MMU_PRINT
mmu_print
#endif
putc 'H'
mmu_engage
movel L(memory_start),availmem
#ifdef CONFIG_AMIGA
is_not_amiga(1f)
clrl L(custom)
1:
#endif
#ifdef CONFIG_ATARI
is_not_atari(1f)
movel #0xff000000,L(iobase)
1:
#endif
#ifdef CONFIG_MAC
is_not_mac(1f)
movel #~VIDEOMEMMASK,%d0
andl L(mac_videobase),%d0
addl #VIDEOMEMBASE,%d0
movel %d0,L(mac_videobase)
#ifdef CONSOLE_DEBUG
movel %pc@(L(phys_kernel_start)),%d0
subl #PAGE_OFFSET,%d0
subl %d0,L(console_font)
subl %d0,L(console_font_data)
#endif
orl #0x50000000,L(mac_sccbase)
1:
#endif
#ifdef CONFIG_HP300
is_not_hp300(2f)
movel #0xf0000000,L(iobase)
is_040(1f)
movel #0x60,0xf05f400c
jbra 2f
1: movew #0,0xf05f400e
movew #0x64,0xf05f400e
2:
#endif
#ifdef CONFIG_SUN3X
is_not_sun3x(1f)
oriw #0x4000,0x61000000
1:
#endif
#ifdef CONFIG_APOLLO
is_not_apollo(1f)
movel #0x80000000,L(iobase)
1:
#endif
putc 'I'
leds 0x10
is_not_040_or_060(L(cache_not_680460))
L(cache680460):
.chip 68040
nop
cpusha %bc
nop
is_060(L(cache68060))
movel #CC6_ENABLE_D+CC6_ENABLE_I,%d0
movec %d0,%cacr
jra L(cache_done)
L(cache68060):
movel #CC6_ENABLE_D+CC6_ENABLE_I+CC6_ENABLE_SB+CC6_PUSH_DPI+CC6_ENABLE_B+CC6_CLRA_B,%d0
movec %d0,%cacr
moveq #1,%d0
.chip 68060
movec %d0,%pcr
jbra L(cache_done)
L(cache_not_680460):
L(cache68030):
.chip 68030
movel #CC3_ENABLE_DB+CC3_CLR_D+CC3_ENABLE_D+CC3_ENABLE_IB+CC3_CLR_I+CC3_ENABLE_I,%d0
movec %d0,%cacr
jra L(cache_done)
.chip 68k
L(cache_done):
putc 'J'
lea init_task,%curptr
lea init_thread_union+THREAD_SIZE,%sp
putc 'K'
subl %a6,%a6
jbsr base_trap_init
putc '\n'
leds 0x55
jbsr start_kernel
func_start get_bi_record,%d1
movel ARG1,%d0
lea %pc@(_end),%a0
1: tstw %a0@(BIR_TAG)
jeq 3f
cmpw %a0@(BIR_TAG),%d0
jeq 2f
addw %a0@(BIR_SIZE),%a0
jra 1b
2: moveq #0,%d0
movew %a0@(BIR_SIZE),%d0
lea %a0@(BIR_DATA),%a0
jra 4f
3: moveq #-1,%d0
lea %a0@(BIR_SIZE),%a0
4:
func_return get_bi_record
#ifdef MMU_PRINT
#define mmu_next_valid 0
#define mmu_start_logical 4
#define mmu_next_logical 8
#define mmu_start_physical 12
#define mmu_next_physical 16
#define MMU_PRINT_INVALID -1
#define MMU_PRINT_VALID 1
#define MMU_PRINT_UNINITED 0
#define putZc(z,n) jbne 1f; putc z; jbra 2f; 1: putc n; 2:
func_start mmu_print,%a0-%a6/%d0-%d7
movel %pc@(L(kernel_pgdir_ptr)),%a5
lea %pc@(L(mmu_print_data)),%a0
movel #MMU_PRINT_UNINITED,%a0@(mmu_next_valid)
is_not_040_or_060(mmu_030_print)
mmu_040_print:
puts "\nMMU040\n"
puts "rp:"
putn %a5
putc '\n'
#if 0
movel #ROOT_TABLE_SIZE,%d5
#if 0
movel %a5@+,%d7 | Burn an entry to skip the kernel mappings,
subql #1,%d5 | they (might) work
#endif
1: tstl %d5
jbeq mmu_print_done
subq #1,%d5
movel %a5@+,%d7
btst #1,%d7
jbeq 1b
2: putn %d7
andil #0xFFFFFE00,%d7
movel %d7,%a4
movel #PTR_TABLE_SIZE,%d4
putc ' '
3: tstl %d4
jbeq 11f
subq #1,%d4
movel %a4@+,%d7
btst #1,%d7
jbeq 3b
4: putn %d7
andil #0xFFFFFF00,%d7
movel %d7,%a3
movel #PAGE_TABLE_SIZE,%d3
5: movel #8,%d2
6: tstl %d3
jbeq 31f
subq #1,%d3
movel %a3@+,%d6
btst #0,%d6
jbeq 6b
7: tstl %d2
jbeq 8f
subq #1,%d2
putc ' '
jbra 91f
8: putc '\n'
movel #8+1+8+1+1,%d2
9: putc ' '
dbra %d2,9b
movel #7,%d2
91: putn %d6
jbra 6b
31: putc '\n'
movel #8+1,%d2
32: putc ' '
dbra %d2,32b
jbra 3b
11: putc '\n'
jbra 1b
#endif
lea %pc@(kernel_pg_dir),%a5
movel %a5,%a0
movel #0x00000000,%a4
moveql #0,%d0
40:
movel %a4,%d5
addil #PAGESIZE<<13,%d5
movel %a0@+,%d6
btst #1,%d6
jbne 41f
jbsr mmu_print_tuple_invalidate
jbra 48f
41:
movel #0,%d1
andil #0xfffffe00,%d6
movel %d6,%a1
42:
movel %a4,%d5
addil #PAGESIZE<<6,%d5
movel %a1@+,%d6
btst #1,%d6
jbne 43f
jbsr mmu_print_tuple_invalidate
jbra 47f
43:
movel #0,%d2
andil #0xffffff00,%d6
movel %d6,%a2
44:
movel %a4,%d5
addil #PAGESIZE,%d5
movel %a2@+,%d6
btst #0,%d6
jbne 45f
jbsr mmu_print_tuple_invalidate
jbra 46f
45:
moveml %d0-%d1,%sp@-
movel %a4,%d0
movel %d6,%d1
andil #0xfffff4e0,%d1
lea %pc@(mmu_040_print_flags),%a6
jbsr mmu_print_tuple
moveml %sp@+,%d0-%d1
46:
movel %d5,%a4
addq #1,%d2
cmpib #64,%d2
jbne 44b
47:
movel %d5,%a4
addq #1,%d1
cmpib #128,%d1
jbne 42b
48:
movel %d5,%a4
addq #1,%d0
cmpib #128,%d0
jbne 40b
.chip 68040
movec %dtt1,%d0
movel %d0,%d1
andiw #0x8000,%d1
jbeq 1f
movel %d0,%d1
andil #0xff000000,%d1
putn %d1
puts "=="
putn %d1
movel %d0,%d6
jbsr mmu_040_print_flags_tt
1:
movec %dtt0,%d0
movel %d0,%d1
andiw #0x8000,%d1
jbeq 1f
movel %d0,%d1
andil #0xff000000,%d1
putn %d1
puts "=="
putn %d1
movel %d0,%d6
jbsr mmu_040_print_flags_tt
1:
.chip 68k
jbra mmu_print_done
mmu_040_print_flags:
btstl #10,%d6
putZc(' ','G')
btstl #7,%d6
putZc(' ','S')
mmu_040_print_flags_tt:
btstl #6,%d6
jbne 3f
putc 'C'
btstl #5,%d6
putZc('w','c')
jbra 4f
3:
putc 'N'
btstl #5,%d6
putZc('s',' ')
4:
rts
mmu_030_print_flags:
btstl #6,%d6
putZc('C','I')
rts
mmu_030_print:
puts "\nMMU030\n"
puts "\nrp:"
putn %a5
putc '\n'
movel %a5,%d0
andil #0xfffffff0,%d0
movel %d0,%a0
movel #0x00000000,%a4
movel #0,%d0
30:
movel %a4,%d5
addil #PAGESIZE<<13,%d5
movel %a0@+,%d6
btst #1,%d6
jbne 31f
btst #0,%d6
jbeq 1f
jbsr mmu_030_print_helper
jbra 38f
1:
jbsr mmu_print_tuple_invalidate
jbra 38f
31:
movel #0,%d1
andil #0xfffffff0,%d6
movel %d6,%a1
32:
movel %a4,%d5
addil #PAGESIZE<<6,%d5
movel %a1@+,%d6
btst #1,%d6
jbne 33f
btst #0,%d6
jbeq 1f
jbsr mmu_030_print_helper
jbra 37f
1:
jbsr mmu_print_tuple_invalidate
jbra 37f
33:
movel #0,%d2
andil #0xfffffff0,%d6
movel %d6,%a2
34:
movel %a4,%d5
addil #PAGESIZE,%d5
movel %a2@+,%d6
btst #0,%d6
jbne 35f
jbsr mmu_print_tuple_invalidate
jbra 36f
35:
jbsr mmu_030_print_helper
36:
movel %d5,%a4
addq #1,%d2
cmpib #64,%d2
jbne 34b
37:
movel %d5,%a4
addq #1,%d1
cmpib #128,%d1
jbne 32b
38:
movel %d5,%a4
addq #1,%d0
cmpib #128,%d0
jbne 30b
mmu_print_done:
puts "\n"
func_return mmu_print
mmu_030_print_helper:
moveml %d0-%d1,%sp@-
movel %a4,%d0
movel %d6,%d1
lea %pc@(mmu_030_print_flags),%a6
jbsr mmu_print_tuple
moveml %sp@+,%d0-%d1
rts
mmu_print_tuple_invalidate:
moveml %a0/%d7,%sp@-
lea %pc@(L(mmu_print_data)),%a0
tstl %a0@(mmu_next_valid)
jbmi mmu_print_tuple_invalidate_exit
movel #MMU_PRINT_INVALID,%a0@(mmu_next_valid)
putn %a4
puts "##\n"
mmu_print_tuple_invalidate_exit:
moveml %sp@+,%a0/%d7
rts
mmu_print_tuple:
moveml %d0-%d7/%a0,%sp@-
lea %pc@(L(mmu_print_data)),%a0
tstl %a0@(mmu_next_valid)
jble mmu_print_tuple_print
cmpl %a0@(mmu_next_physical),%d1
jbeq mmu_print_tuple_increment
mmu_print_tuple_print:
putn %d0
puts "->"
putn %d1
movel %d1,%d6
jbsr %a6@
mmu_print_tuple_record:
movel #MMU_PRINT_VALID,%a0@(mmu_next_valid)
movel %d1,%a0@(mmu_next_physical)
mmu_print_tuple_increment:
movel %d5,%d7
subl %a4,%d7
addl %d7,%a0@(mmu_next_physical)
mmu_print_tuple_exit:
moveml %sp@+,%d0-%d7/%a0
rts
mmu_print_machine_cpu_types:
puts "machine: "
is_not_amiga(1f)
puts "amiga"
jbra 9f
1:
is_not_atari(2f)
puts "atari"
jbra 9f
2:
is_not_mac(3f)
puts "macintosh"
jbra 9f
3: puts "unknown"
9: putc '\n'
puts "cputype: 0"
is_not_060(1f)
putc '6'
jbra 9f
1:
is_not_040_or_060(2f)
putc '4'
jbra 9f
2: putc '3'
9: putc '0'
putc '\n'
rts
#endif
func_start mmu_map_tt,%d0/%d1/%a0,4
dputs "mmu_map_tt:"
dputn ARG1
dputn ARG2
dputn ARG3
dputn ARG4
dputc '\n'
is_020(L(do_map))
bfffo ARG3{#0,#32},%d1
cmpw #8,%d1
jcc L(do_map)
moveq #-1,%d0
lsrl %d1,%d0
lsrl #1,%d0
movel %d0,%d1
notl %d1
andl ARG2,%d1
lsrl #8,%d0
orl %d0,%d1
clrw %d1
is_040_or_060(L(mmu_map_tt_040))
orw #TTR_ENABLE+TTR_RWM+TTR_FCB2+TTR_FCM1+TTR_FCM0,%d1
movel ARG4,%d0
btst #6,%d0
jeq 1f
orw #TTR_CI,%d1
1: lea STACK,%a0
dputn %d1
movel %d1,%a0@
.chip 68030
tstl ARG1
jne 1f
pmove %a0@,%tt0
jra 2f
1: pmove %a0@,%tt1
2: .chip 68k
jra L(mmu_map_tt_done)
L(mmu_map_tt_040):
orw #TTR_ENABLE+TTR_KERNELMODE,%d1
orl ARG4,%d1
dputn %d1
.chip 68040
tstl ARG1
jne 1f
movec %d1,%itt0
movec %d1,%dtt0
jra 2f
1: movec %d1,%itt1
movec %d1,%dtt1
2: .chip 68k
jra L(mmu_map_tt_done)
L(do_map):
mmu_map_eq ARG2,ARG3,ARG4
L(mmu_map_tt_done):
func_return mmu_map_tt
func_start mmu_map,%d0-%d4/%a0-%a4
dputs "\nmmu_map:"
dputn ARG1
dputn ARG2
dputn ARG3
dputn ARG4
dputc '\n'
movel ARG1,%d0
andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
movel %d0,%a3
movel ARG1,%a4
addl ARG3,%a4
subql #1,%a4
movel ARG2,%d0
andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
movel %d0,%a2
movel ARG4,%d0
orw #_PAGE_PRESENT+_PAGE_ACCESSED+_PAGE_DIRTY,%d0
addw %d0,%a2
dputn %a2
dputn %a3
dputn %a4
is_not_040_or_060(L(mmu_map_030))
addw #_PAGE_GLOBAL040,%a2
L(mmu_map_040):
movel %a3,%d0
moveq #ROOT_INDEX_SHIFT,%d1
lsrl %d1,%d0
mmu_get_root_table_entry %d0
movel %a3,%d0
moveq #PTR_INDEX_SHIFT,%d1
lsrl %d1,%d0
andl #PTR_TABLE_SIZE-1,%d0
mmu_get_ptr_table_entry %a0,%d0
movel %a3,%d0
moveq #PAGE_INDEX_SHIFT,%d1
lsrl %d1,%d0
andl #PAGE_TABLE_SIZE-1,%d0
mmu_get_page_table_entry %a0,%d0
tstl %a0@
jne L(mmu_map_error)
movel %a2,%a0@
2:
addw #PAGESIZE,%a2
addw #PAGESIZE,%a3
lea %a3@(-1),%a0
cmpl %a0,%a4
jhi L(mmu_map_040)
jra L(mmu_map_done)
L(mmu_map_030):
movel %a3,%d0
moveq #ROOT_INDEX_SHIFT,%d1
lsrl %d1,%d0
mmu_get_root_table_entry %d0
movel %a3,%d0
andl #(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1)&(-ROOT_TABLE_SIZE),%d0
jne 1f
lea %a3@(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1),%a1
cmpl %a1,%a4
jcs 1f
addql #1,%a1
tstl %a0@
jne L(mmu_map_error)
dputs "early term1"
dputn %a2
dputn %a3
dputn %a1
dputc '\n'
movel %a2,%a0@
movel %a1,%a3
lea %a2@(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE),%a2
jra L(mmu_mapnext_030)
1:
movel %a3,%d0
moveq #PTR_INDEX_SHIFT,%d1
lsrl %d1,%d0
andl #PTR_TABLE_SIZE-1,%d0
mmu_get_ptr_table_entry %a0,%d0
tstl %a0@
jne L(mmu_map_error)
dputs "early term2"
dputn %a2
dputn %a3
dputc '\n'
movel %a2,%a0@
addl #PAGE_TABLE_SIZE*PAGESIZE,%a2
addl #PAGE_TABLE_SIZE*PAGESIZE,%a3
L(mmu_mapnext_030):
lea %a3@(-1),%a0
cmpl %a0,%a4
jhi L(mmu_map_030)
jra L(mmu_map_done)
L(mmu_map_error):
dputs "mmu_map error:"
dputn %a2
dputn %a3
dputc '\n'
L(mmu_map_done):
func_return mmu_map
func_start mmu_fixup_page_mmu_cache,%d0/%a0
dputs "mmu_fixup_page_mmu_cache"
dputn ARG1
movel ARG1,%d0
moveq #ROOT_INDEX_SHIFT,%d1
lsrl %d1,%d0
mmu_get_root_table_entry %d0
movel ARG1,%d0
moveq #PTR_INDEX_SHIFT,%d1
lsrl %d1,%d0
andl #PTR_TABLE_SIZE-1,%d0
mmu_get_ptr_table_entry %a0,%d0
movel ARG1,%d0
moveq #PAGE_INDEX_SHIFT,%d1
lsrl %d1,%d0
andl #PAGE_TABLE_SIZE-1,%d0
mmu_get_page_table_entry %a0,%d0
movel %a0@,%d0
andil #_CACHEMASK040,%d0
orl %pc@(m68k_pgtable_cachemode),%d0
movel %d0,%a0@
dputc '\n'
func_return mmu_fixup_page_mmu_cache
func_start mmu_temp_map,%d0/%d1/%a0/%a1
dputs "mmu_temp_map"
dputn ARG1
dputn ARG2
dputc '\n'
lea %pc@(L(temp_mmap_mem)),%a1
movel ARG2,%d0
moveq #ROOT_INDEX_SHIFT,%d1
lsrl %d1,%d0
mmu_get_root_table_entry %d0
movel %a0@,%d0
cmpl %pc@(L(memory_start)),%d0
jcc 1f
movel %a1@,%d0
addl #PTR_TABLE_SIZE*4,%a1@
orw #_PAGE_TABLE+_PAGE_ACCESSED,%d0
movel %d0,%a0@
dputs " (new)"
1:
dputn %d0
andw #-ROOT_TABLE_SIZE,%d0
movel %d0,%a0
movel ARG2,%d0
moveq #PTR_INDEX_SHIFT,%d1
lsrl %d1,%d0
andl #PTR_TABLE_SIZE-1,%d0
lea %a0@(%d0*4),%a0
dputn %a0
movel %a0@,%d0
jne 1f
movel %a1@,%d0
addl #512,%a1@
orw #_PAGE_TABLE+_PAGE_ACCESSED,%d0
movel %d0,%a0@
dputs " (new)"
1:
dputn %d0
andw #-PTR_TABLE_SIZE,%d0
movel %d0,%a0
movel ARG2,%d0
moveq #PAGE_INDEX_SHIFT,%d1
lsrl %d1,%d0
andl #PAGE_TABLE_SIZE-1,%d0
lea %a0@(%d0*4),%a0
dputn %a0
movel ARG1,%d0
andw #-PAGESIZE,%d0
orw #_PAGE_PRESENT+_PAGE_ACCESSED+_PAGE_DIRTY,%d0
movel %d0,%a0@
dputn %d0
dputc '\n'
func_return mmu_temp_map
func_start mmu_engage,%d0-%d2/%a0-%a3
moveq #ROOT_TABLE_SIZE-1,%d0
lea %pc@(L(kernel_pgdir_ptr)),%a0
movel %a0@,%a2
movel %pc@(L(memory_start)),%a1
movel %a1,%a0@
movel %a2,%a0
1:
movel %a0@+,%a1@+
dbra %d0,1b
lea %pc@(L(temp_mmap_mem)),%a0
movel %a1,%a0@
movew #PAGESIZE-1,%d0
1:
clrl %a1@+
dbra %d0,1b
lea %pc@(1b),%a0
movel #1b,%a1
cmpl %a0,%a1
jeq 1f
mmu_temp_map %a0,%a0
mmu_temp_map %a0,%a1
addw #PAGESIZE,%a0
addw #PAGESIZE,%a1
mmu_temp_map %a0,%a0
mmu_temp_map %a0,%a1
1:
movel %pc@(L(memory_start)),%a3
movel %pc@(L(phys_kernel_start)),%d2
is_not_040_or_060(L(mmu_engage_030))
L(mmu_engage_040):
.chip 68040
nop
cinva %bc
nop
pflusha
nop
movec %a3,%srp
movel #TC_ENABLE+TC_PAGE4K,%d0
movec %d0,%tc
jmp 1f:l
1: nop
movec %a2,%srp
nop
cinva %bc
nop
pflusha
.chip 68k
jra L(mmu_engage_cleanup)
L(mmu_engage_030_temp):
.space 12
L(mmu_engage_030):
.chip 68030
lea %pc@(L(mmu_engage_030_temp)),%a0
movel #0x80000002,%a0@
movel %a3,%a0@(4)
movel #0x0808,%d0
movec %d0,%cacr
pmove %a0@,%srp
pflusha
movel #0x82c07760,%a0@(8)
pmove %a0@(8),%tc
jmp 1f:l
1: movel %a2,%a0@(4)
movel #0x0808,%d0
movec %d0,%cacr
pmove %a0@,%srp
pflusha
.chip 68k
L(mmu_engage_cleanup):
subl #PAGE_OFFSET,%d2
subl %d2,%a2
movel %a2,L(kernel_pgdir_ptr)
subl %d2,%fp
subl %d2,%sp
subl %d2,ARG0
func_return mmu_engage
func_start mmu_get_root_table_entry,%d0/%a1
#if 0
dputs "mmu_get_root_table_entry:"
dputn ARG1
dputs " ="
#endif
movel %pc@(L(kernel_pgdir_ptr)),%a0
tstl %a0
jne 2f
dputs "\nmmu_init:"
get_bi_record BI_LAST
addw #PAGESIZE-1,%a0
movel %a0,%d0
andw #-PAGESIZE,%d0
dputn %d0
lea %pc@(L(memory_start)),%a0
movel %d0,%a0@
lea %pc@(L(kernel_end)),%a0
movel %d0,%a0@
lea %pc@(_stext),%a0
lea %pc@(L(mmu_cached_pointer_tables)),%a1
movel %a0,%a1@
addl #ROOT_TABLE_SIZE*4,%a1@
lea %pc@(L(mmu_num_pointer_tables)),%a1
addql #1,%a1@
movel %a0,%a1
movew #PAGESIZE/4-1,%d0
1:
clrl %a1@+
dbra %d0,1b
lea %pc@(L(kernel_pgdir_ptr)),%a1
movel %a0,%a1@
dputn %a0
dputc '\n'
2:
movel ARG1,%d0
lea %a0@(%d0*4),%a0
#if 0
dputn %a0
dputc '\n'
#endif
func_return mmu_get_root_table_entry
func_start mmu_get_ptr_table_entry,%d0/%a1
#if 0
dputs "mmu_get_ptr_table_entry:"
dputn ARG1
dputn ARG2
dputs " ="
#endif
movel ARG1,%a0
movel %a0@,%d0
jne 2f
dputs "\nmmu_get_new_ptr_table:"
lea %pc@(L(mmu_num_pointer_tables)),%a0
movel %a0@,%d0
addql #1,%a0@
lea %pc@(L(mmu_cached_pointer_tables)),%a1
andw #7,%d0
jne 1f
get_new_page
movel %a0,%a1@
1:
movel %a1@,%d0
addl #PTR_TABLE_SIZE*4,%a1@
dputn %d0
dputc '\n'
movel ARG1,%a0
orw #_PAGE_TABLE+_PAGE_ACCESSED,%d0
movel %d0,%a0@
2:
andw #-PTR_TABLE_SIZE,%d0
movel %d0,%a0
movel ARG2,%d0
lea %a0@(%d0*4),%a0
#if 0
dputn %a0
dputc '\n'
#endif
func_return mmu_get_ptr_table_entry
func_start mmu_get_page_table_entry,%d0/%a1
#if 0
dputs "mmu_get_page_table_entry:"
dputn ARG1
dputn ARG2
dputs " ="
#endif
movel ARG1,%a0
movel %a0@,%d0
jne 2f
get_new_page
addw #_PAGE_TABLE+_PAGE_ACCESSED,%a0
movel ARG1,%d0
andw #-(PAGESIZE/PAGE_TABLE_SIZE),%d0
movel %d0,%a1
moveq #PAGESIZE/PAGE_TABLE_SIZE/4-1,%d0
1:
movel %a0,%a1@+
lea %a0@(PAGE_TABLE_SIZE*4),%a0
dbra %d0,1b
movel ARG1,%a0
movel %a0@,%d0
2:
andw #-PAGE_TABLE_SIZE,%d0
movel %d0,%a0
movel ARG2,%d0
lea %a0@(%d0*4),%a0
#if 0
dputn %a0
dputc '\n'
#endif
func_return mmu_get_page_table_entry
func_start get_new_page,%d0/%a1
dputs "\nget_new_page:"
lea %pc@(L(memory_start)),%a0
movel %a0@,%a1
addl #PAGESIZE,%a0@
movel %a1,%a0
movew #PAGESIZE/4-1,%d0
1:
clrl %a1@+
dbra %d0,1b
dputn %a0
dputc '\n'
func_return get_new_page
#ifdef CONFIG_MAC
#define MAC_USE_SCC_A
#define MAC_USE_SCC_B
#if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
L(scc_initable_mac):
.byte 4,0x44
.byte 3,0xc0
.byte 5,0xe2
.byte 10,0
.byte 11,0x50
.byte 12,1,13,0
.byte 14,1
.byte 3,0xc1
.byte 5,0xea
.byte -1
.even
#endif
#endif
#ifdef CONFIG_ATARI
#define USE_MFP
#if defined(USE_SCC_A) || defined(USE_SCC_B)
L(scc_initable_atari):
.byte 4,0x44
.byte 3,0xc0
.byte 5,0xe2
.byte 10,0
.byte 11,0x50
.byte 12,24,13,0
.byte 14,2,14,3
.byte 3,0xc1
.byte 5,0xea
.byte -1
.even
#endif
#ifdef USE_PRINTER
LPSG_SELECT = 0xff8800
LPSG_READ = 0xff8800
LPSG_WRITE = 0xff8802
LPSG_IO_A = 14
LPSG_IO_B = 15
LPSG_CONTROL = 7
LSTMFP_GPIP = 0xfffa01
LSTMFP_DDR = 0xfffa05
LSTMFP_IERB = 0xfffa09
#elif defined(USE_SCC_B)
LSCC_CTRL = 0xff8c85
LSCC_DATA = 0xff8c87
#elif defined(USE_SCC_A)
LSCC_CTRL = 0xff8c81
LSCC_DATA = 0xff8c83
#elif defined(USE_MFP)
LMFP_UCR = 0xfffa29
LMFP_TDCDR = 0xfffa1d
LMFP_TDDR = 0xfffa25
LMFP_TSR = 0xfffa2d
LMFP_UDR = 0xfffa2f
#endif
#endif
func_start serial_init,%d0/%d1/%a0/%a1
#ifdef CONFIG_AMIGA
#define SERIAL_DTR 7
#define SERIAL_CNTRL CIABBASE+C_PRA
is_not_amiga(1f)
lea %pc@(L(custom)),%a0
movel #-ZTWOBASE,%a0@
bclr #SERIAL_DTR,SERIAL_CNTRL-ZTWOBASE
get_bi_record BI_AMIGA_SERPER
movew %a0@,CUSTOMBASE+C_SERPER-ZTWOBASE
| movew #61,CUSTOMBASE+C_SERPER-ZTWOBASE
1:
#endif
#ifdef CONFIG_ATARI
is_not_atari(4f)
movel %pc@(L(iobase)),%a1
#if defined(USE_PRINTER)
bclr #0,%a1@(LSTMFP_IERB)
bclr #0,%a1@(LSTMFP_DDR)
moveb #LPSG_CONTROL,%a1@(LPSG_SELECT)
moveb #0xff,%a1@(LPSG_WRITE)
moveb #LPSG_IO_B,%a1@(LPSG_SELECT)
clrb %a1@(LPSG_WRITE)
moveb #LPSG_IO_A,%a1@(LPSG_SELECT)
moveb %a1@(LPSG_READ),%d0
bset #5,%d0
moveb %d0,%a1@(LPSG_WRITE)
#elif defined(USE_SCC_A) || defined(USE_SCC_B)
lea %a1@(LSCC_CTRL),%a0
moveb %a0@,%d0
moveb #9,%a0@
moveb #0xc0,%a0@
movel #32,%d0
2:
subq #1,%d0
jne 2b
lea %pc@(L(scc_initable_atari)),%a1
2: moveb %a1@+,%d0
jmi 3f
moveb %d0,%a0@
moveb %a1@+,%a0@
jra 2b
3: clrb %a0@
#elif defined(USE_MFP)
bclr #1,%a1@(LMFP_TSR)
moveb #0x88,%a1@(LMFP_UCR)
andb #0x70,%a1@(LMFP_TDCDR)
moveb #2,%a1@(LMFP_TDDR)
orb #1,%a1@(LMFP_TDCDR)
bset #1,%a1@(LMFP_TSR)
#endif
jra L(serial_init_done)
4:
#endif
#ifdef CONFIG_MAC
is_not_mac(L(serial_init_not_mac))
#if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
#define mac_scc_cha_b_ctrl_offset 0x0
#define mac_scc_cha_a_ctrl_offset 0x2
#define mac_scc_cha_b_data_offset 0x4
#define mac_scc_cha_a_data_offset 0x6
movel %pc@(L(mac_sccbase)),%a0
moveb %a0@(mac_scc_cha_a_ctrl_offset),%d0
moveb #9,%a0@(mac_scc_cha_a_ctrl_offset)
moveb #0xc0,%a0@(mac_scc_cha_a_ctrl_offset)
movel #35,%d0
5:
subq #1,%d0
jne 5b
#endif
#ifdef MAC_USE_SCC_A
lea %pc@(L(scc_initable_mac)),%a1
5: moveb %a1@+,%d0
jmi 6f
moveb %d0,%a0@(mac_scc_cha_a_ctrl_offset)
moveb %a1@+,%a0@(mac_scc_cha_a_ctrl_offset)
jra 5b
6:
#endif
#ifdef MAC_USE_SCC_B
lea %pc@(L(scc_initable_mac)),%a1
7: moveb %a1@+,%d0
jmi 8f
moveb %d0,%a0@(mac_scc_cha_b_ctrl_offset)
moveb %a1@+,%a0@(mac_scc_cha_b_ctrl_offset)
jra 7b
8:
#endif
jra L(serial_init_done)
L(serial_init_not_mac):
#endif
#ifdef CONFIG_Q40
is_not_q40(2f)
lea %pc@(q40_mem_cptr),%a1
move.l #0xff020010,%a1@
move.l #0xff020000,%a1
cmp.b #'%',%a1@
bne 2f
addq.w #4,%a1
cmp.b #'L',%a1@
bne 2f
addq.w #4,%a1
cmp.b #'X',%a1@
bne 2f
addq.w #4,%a1
cmp.b #'$',%a1@
bne 2f
lea %pc@(L(q40_do_debug)),%a1
tas %a1@
2:
#endif
#ifdef CONFIG_MVME16x
is_not_mvme16x(L(serial_init_not_mvme16x))
moveb #0x10,M167_PCSCCMICR
moveb #0x10,M167_PCSCCTICR
moveb #0x10,M167_PCSCCRICR
jra L(serial_init_done)
L(serial_init_not_mvme16x):
#endif
#ifdef CONFIG_APOLLO
#endif
#ifdef CONFIG_HP300
#endif
L(serial_init_done):
func_return serial_init
func_start serial_putc,%d0/%d1/%a0/%a1
movel ARG1,%d0
cmpib #'\n',%d0
jbne 1f
serial_putc #'\r'
1:
#ifdef CONFIG_AMIGA
is_not_amiga(2f)
andw #0x00ff,%d0
oriw #0x0100,%d0
movel %pc@(L(custom)),%a0
movew %d0,%a0@(CUSTOMBASE+C_SERDAT)
1: movew %a0@(CUSTOMBASE+C_SERDATR),%d0
andw #0x2000,%d0
jeq 1b
jra L(serial_putc_done)
2:
#endif
#ifdef CONFIG_MAC
is_not_mac(5f)
#if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
movel %pc@(L(mac_sccbase)),%a1
#endif
#ifdef MAC_USE_SCC_A
3: btst #2,%a1@(mac_scc_cha_a_ctrl_offset)
jeq 3b
moveb %d0,%a1@(mac_scc_cha_a_data_offset)
#endif
#ifdef MAC_USE_SCC_B
4: btst #2,%a1@(mac_scc_cha_b_ctrl_offset)
jeq 4b
moveb %d0,%a1@(mac_scc_cha_b_data_offset)
#endif
jra L(serial_putc_done)
5:
#endif
#ifdef CONFIG_ATARI
is_not_atari(4f)
movel %pc@(L(iobase)),%a1
#if defined(USE_PRINTER)
3: btst #0,%a1@(LSTMFP_GPIP)
jne 3b
moveb #LPSG_IO_B,%a1@(LPSG_SELECT)
moveb %d0,%a1@(LPSG_WRITE)
moveb #LPSG_IO_A,%a1@(LPSG_SELECT)
moveb %a1@(LPSG_READ),%d0
bclr #5,%d0
moveb %d0,%a1@(LPSG_WRITE)
nop
nop
bset #5,%d0
moveb %d0,%a1@(LPSG_WRITE)
#elif defined(USE_SCC_A) || defined(USE_SCC_B)
3: btst #2,%a1@(LSCC_CTRL)
jeq 3b
moveb %d0,%a1@(LSCC_DATA)
#elif defined(USE_MFP)
3: btst #7,%a1@(LMFP_TSR)
jeq 3b
moveb %d0,%a1@(LMFP_UDR)
#endif
jra L(serial_putc_done)
4:
#endif
#ifdef CONFIG_MVME147
is_not_mvme147(2f)
1: btst #2,M147_SCC_CTRL_A
jeq 1b
moveb %d0,M147_SCC_DATA_A
jbra L(serial_putc_done)
2:
#endif
#ifdef CONFIG_MVME16x
is_not_mvme16x(2f)
moveml %d0-%d7/%a2-%a6,%sp@-
movel vme_brdtype,%d1
jeq 1f | No tag - use the Bug
cmpi #VME_TYPE_MVME162,%d1
jeq 6f
cmpi #VME_TYPE_MVME172,%d1
jne 5f
6: btst #2,M162_SCC_CTRL_A
nop
nop
nop
jeq 6b
moveb #8,M162_SCC_CTRL_A
nop
nop
nop
moveb %d0,M162_SCC_CTRL_A
jra 3f
5:
moveb #0,M167_CYCAR
moveb M167_CYIER,%d2
moveb #0x02,M167_CYIER
7:
btst #5,M167_PCSCCTICR
jeq 7b
moveb M167_PCTPIACKR,%d1
moveb M167_CYLICR,%d1
jeq 8f
moveb #0x08,M167_CYTEOIR
jra 7b
8:
moveb %d0,M167_CYTDR
moveb #0,M167_CYTEOIR
moveb %d2,M167_CYIER
jra 3f
1:
moveb %d0,%sp@-
trap #15
.word 0x0020
3:
moveml %sp@+,%d0-%d7/%a2-%a6
jbra L(serial_putc_done)
2:
#endif
#ifdef CONFIG_BVME6000
is_not_bvme6000(2f)
1: btst #2,BVME_SCC_CTRL_A
jeq 1b
moveb %d0,BVME_SCC_DATA_A
jbra L(serial_putc_done)
2:
#endif
#ifdef CONFIG_SUN3X
is_not_sun3x(2f)
movel %d0,-(%sp)
movel 0xFEFE0018,%a1
jbsr (%a1)
addq #4,%sp
jbra L(serial_putc_done)
2:
#endif
#ifdef CONFIG_Q40
is_not_q40(2f)
tst.l %pc@(L(q40_do_debug))
beq 2f
lea %pc@(q40_mem_cptr),%a1
move.l %a1@,%a0
move.b %d0,%a0@
addq.l #4,%a0
move.l %a0,%a1@
jbra L(serial_putc_done)
2:
#endif
#ifdef CONFIG_APOLLO
is_not_apollo(2f)
movl %pc@(L(iobase)),%a1
moveb %d0,%a1@(LTHRB0)
1: moveb %a1@(LSRB0),%d0
andb #0x4,%d0
beq 1b
jbra L(serial_putc_done)
2:
#endif
#ifdef CONFIG_HP300
is_not_hp300(3f)
movl %pc@(L(iobase)),%a1
addl %pc@(L(uartbase)),%a1
movel %pc@(L(uart_scode)),%d1
jmi 3f
cmpi #256,%d1
jeq 2f
1: moveb %a1@(DCALSR),%d1
andb #0x20,%d1
beq 1b
moveb %d0,%a1@(DCADATA)
jbra L(serial_putc_done)
2: moveb %a1@(APCILSR),%d1
andb #0x20,%d1
beq 2b
moveb %d0,%a1@(APCIDATA)
jbra L(serial_putc_done)
3:
#endif
#ifdef CONFIG_VIRT
is_not_virt(1f)
movel L(virt_gf_tty_base),%a1
movel %d0,%a1@(GF_PUT_CHAR)
1:
#endif
L(serial_putc_done):
func_return serial_putc
func_start puts,%d0/%a0
movel ARG1,%a0
jra 2f
1:
#ifdef CONSOLE_DEBUG
console_putc %d0
#endif
#ifdef SERIAL_DEBUG
serial_putc %d0
#endif
2: moveb %a0@+,%d0
jne 1b
func_return puts
func_start putn,%d0-%d2
putc ' '
movel ARG1,%d0
moveq #7,%d1
1: roll #4,%d0
move %d0,%d2
andb #0x0f,%d2
addb #'0',%d2
cmpb #'9',%d2
jls 2f
addb #'A'-('9'+1),%d2
2:
#ifdef CONSOLE_DEBUG
console_putc %d2
#endif
#ifdef SERIAL_DEBUG
serial_putc %d2
#endif
dbra %d1,1b
func_return putn
#ifdef CONFIG_EARLY_PRINTK
ENTRY(debug_cons_nputs)
moveml %d0/%d1/%a0,%sp@-
movew %sr,%sp@-
ori #0x0700,%sr
movel %sp@(22),%a0
movel %sp@(26),%d1
jra 2f
1:
#ifdef CONSOLE_DEBUG
console_putc %d0
#endif
#ifdef SERIAL_DEBUG
serial_putc %d0
#endif
subq #1,%d1
2: jeq 3f
moveb %a0@+,%d0
jne 1b
3:
movew %sp@+,%sr
moveml %sp@+,%d0/%d1/%a0
rts
#endif
#if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
func_start set_leds,%d0/%a0
movel ARG1,%d0
#ifdef CONFIG_HP300
is_not_hp300(1f)
movel %pc@(L(iobase)),%a0
moveb %d0,%a0@(0x1ffff)
jra 2f
#endif
1:
#ifdef CONFIG_APOLLO
movel %pc@(L(iobase)),%a0
lsll #8,%d0
eorw #0xff00,%d0
moveb %d0,%a0@(LCPUCTRL)
#endif
2:
func_return set_leds
#endif
#ifdef CONSOLE_DEBUG
#define Lconsole_struct_cur_column 0
#define Lconsole_struct_cur_row 4
#define Lconsole_struct_num_columns 8
#define Lconsole_struct_num_rows 12
#define Lconsole_struct_left_edge 16
func_start console_init,%a0-%a4/%d0-%d7
lea %pc@(L(console_globals)),%a2
movel %pc@(L(mac_videobase)),%a1
movel %pc@(L(mac_rowbytes)),%d5
movel %pc@(L(mac_dimensions)),%d3
movel %d3,%d4
swap %d4
andl #0xffff,%d3
andl #0xffff,%d4
movel %d5,%d6
| subl #20,%d6
mulul %d4,%d6
divul #8,%d6
moveq #-1,%d0
subq #1,%d6
L(console_clear_loop):
movel %d0,%a1@+
movel %d0,%a1@+
dbra %d6,L(console_clear_loop)
#if defined(FONT_8x8) && defined(CONFIG_FONT_8x8)
lea %pc@(font_vga_8x8),%a0
#elif defined(FONT_8x16) && defined(CONFIG_FONT_8x16)
lea %pc@(font_vga_8x16),%a0
#elif defined(FONT_6x11) && defined(CONFIG_FONT_6x11)
lea %pc@(font_vga_6x11),%a0
#elif defined(CONFIG_FONT_8x8)
lea %pc@(font_vga_8x8),%a0
#else
lea 0,%a0
#endif
lea %pc@(L(console_font)),%a1
movel %a0,%a1@
tstl %a0
jeq 1f
lea %pc@(L(console_font_data)),%a4
movel %a0@(FONT_DESC_DATA),%d0
subl #L(console_font),%a1
addl %a1,%d0
movel %d0,%a4@
movel %d3,%d0
divul %a0@(FONT_DESC_WIDTH),%d0
movel %d4,%d1
divul %a0@(FONT_DESC_HEIGHT),%d1
subql #1,%d1
movel %d0,%a2@(Lconsole_struct_num_columns)
movel %d1,%a2@(Lconsole_struct_num_rows)
clrl %a2@(Lconsole_struct_cur_column)
clrl %a2@(Lconsole_struct_cur_row)
clrl %a2@(Lconsole_struct_left_edge)
1:
func_return console_init
#ifdef CONFIG_LOGO
func_start console_put_penguin,%a0-%a1/%d0-%d7
lea %pc@(L(mac_dimensions)),%a0
movel %a0@,%d0
andil #0xffff,%d0
subil #64,%d0
clrl %d1
movel #73,%d7
lea %pc@(L(that_penguin)),%a1
L(console_penguin_row):
movel #31,%d6
L(console_penguin_pixel_pair):
moveb %a1@,%d2
lsrb #4,%d2
console_plot_pixel %d0,%d1,%d2
addq #1,%d0
moveb %a1@+,%d2
console_plot_pixel %d0,%d1,%d2
addq #1,%d0
dbra %d6,L(console_penguin_pixel_pair)
subil #64,%d0
addq #1,%d1
dbra %d7,L(console_penguin_row)
func_return console_put_penguin
L(that_penguin):
#include "../mac/mac_penguin.S"
#endif
func_start console_scroll,%a0-%a4/%d0-%d7
lea %pc@(L(mac_videobase)),%a0
movel %a0@,%a1
movel %a1,%a2
lea %pc@(L(mac_rowbytes)),%a0
movel %a0@,%d5
movel %pc@(L(console_font)),%a0
tstl %a0
jeq 1f
mulul %a0@(FONT_DESC_HEIGHT),%d5
addal %d5,%a2
lea %pc@(L(mac_dimensions)),%a0
movel %a0@,%d3
movel %d3,%d4
swap %d4
andl #0xffff,%d3
andl #0xffff,%d4
lea %pc@(L(mac_rowbytes)),%a0
movel %a0@,%d6
movel %pc@(L(console_font)),%a0
subl %a0@(FONT_DESC_HEIGHT),%d4
mulul %d4,%d6
divul #32,%d6
subq #1,%d6
L(console_scroll_loop):
movel %a2@+,%a1@+
movel %a2@+,%a1@+
movel %a2@+,%a1@+
movel %a2@+,%a1@+
movel %a2@+,%a1@+
movel %a2@+,%a1@+
movel %a2@+,%a1@+
movel %a2@+,%a1@+
dbra %d6,L(console_scroll_loop)
lea %pc@(L(mac_rowbytes)),%a0
movel %a0@,%d6
movel %pc@(L(console_font)),%a0
mulul %a0@(FONT_DESC_HEIGHT),%d6
divul #32,%d6
subq #1,%d6
moveq #-1,%d0
L(console_scroll_clear_loop):
movel %d0,%a1@+
movel %d0,%a1@+
movel %d0,%a1@+
movel %d0,%a1@+
movel %d0,%a1@+
movel %d0,%a1@+
movel %d0,%a1@+
movel %d0,%a1@+
dbra %d6,L(console_scroll_clear_loop)
1:
func_return console_scroll
func_start console_putc,%a0/%a1/%d0-%d7
is_not_mac(L(console_exit))
tstl %pc@(L(console_font))
jeq L(console_exit)
lea %pc@(L(console_globals)),%a0
movel ARG1,%d7
cmpib #'\n',%d7
jne L(console_not_lf)
clrl %a0@(Lconsole_struct_cur_column)
movel %a0@(Lconsole_struct_cur_row),%d0
movel %a0@(Lconsole_struct_num_rows),%d1
cmpl %d1,%d0
jcs 1f
console_scroll
jra L(console_exit)
1:
addql #1,%d0
movel %d0,%a0@(Lconsole_struct_cur_row)
jra L(console_exit)
L(console_not_lf):
cmpib #'\r',%d7
jne L(console_not_lf_not_cr)
clrl %a0@(Lconsole_struct_cur_column)
jra L(console_exit)
L(console_not_lf_not_cr):
movel %a0@(Lconsole_struct_cur_column),%d0
movel %a0@(Lconsole_struct_cur_row),%d1
movel %pc@(L(console_font)),%a0
movel %pc@(L(console_font_data)),%a1
andl #0x000000ff,%d7
mulul %a0@(FONT_DESC_HEIGHT),%d7
addl %d7,%a1
mulul %a0@(FONT_DESC_WIDTH),%d0
mulul %a0@(FONT_DESC_HEIGHT),%d1
movel %a0@(FONT_DESC_HEIGHT),%d7
subq #1,%d7
L(console_read_char_scanline):
moveb %a1@+,%d3
movel %a0@(FONT_DESC_WIDTH),%d6
subql #1,%d6
L(console_do_font_scanline):
lslb #1,%d3
scsb %d2
console_plot_pixel %d0,%d1,%d2
addq #1,%d0
dbra %d6,L(console_do_font_scanline)
subl %a0@(FONT_DESC_WIDTH),%d0
addq #1,%d1
dbra %d7,L(console_read_char_scanline)
lea %pc@(L(console_globals)),%a0
movel %a0@(Lconsole_struct_cur_column),%d0
addql #1,%d0
movel %d0,%a0@(Lconsole_struct_cur_column)
movel %a0@(Lconsole_struct_num_columns),%d1
cmpl %d1,%d0
jcs L(console_exit)
console_putc #'\n'
L(console_exit):
func_return console_putc
func_start console_plot_pixel,%a0-%a1/%d0-%d4
movel %pc@(L(mac_videobase)),%a1
movel %pc@(L(mac_videodepth)),%d3
movel ARG1,%d0
movel ARG2,%d1
mulul %pc@(L(mac_rowbytes)),%d1
movel ARG3,%d2
L(test_1bit):
cmpb #1,%d3
jbne L(test_2bit)
movel %d0,%d4
divul #8,%d0
addal %d0,%a1
addal %d1,%a1
andb #7,%d4
eorb #7,%d4
andb #1,%d2
jbne L(white_1)
bsetb %d4,%a1@
jbra L(console_plot_pixel_exit)
L(white_1):
bclrb %d4,%a1@
jbra L(console_plot_pixel_exit)
L(test_2bit):
cmpb #2,%d3
jbne L(test_4bit)
movel %d0,%d4
divul #4,%d0
addal %d0,%a1
addal %d1,%a1
andb #3,%d4
eorb #3,%d4
lsll #1,%d4
andb #1,%d2
jbne L(white_2)
bsetb %d4,%a1@
addq #1,%d4
bsetb %d4,%a1@
jbra L(console_plot_pixel_exit)
L(white_2):
bclrb %d4,%a1@
addq #1,%d4
bclrb %d4,%a1@
jbra L(console_plot_pixel_exit)
L(test_4bit):
cmpb #4,%d3
jbne L(test_8bit)
movel %d0,%d4
divul #2,%d0
addal %d0,%a1
addal %d1,%a1
andb #1,%d4
eorb #1,%d4
lsll #2,%d4
andb #1,%d2
jbne L(white_4)
bsetb %d4,%a1@
addq #1,%d4
bsetb %d4,%a1@
addq #1,%d4
bsetb %d4,%a1@
addq #1,%d4
bsetb %d4,%a1@
jbra L(console_plot_pixel_exit)
L(white_4):
bclrb %d4,%a1@
addq #1,%d4
bclrb %d4,%a1@
addq #1,%d4
bclrb %d4,%a1@
addq #1,%d4
bclrb %d4,%a1@
jbra L(console_plot_pixel_exit)
L(test_8bit):
cmpb #8,%d3
jbne L(test_16bit)
addal %d0,%a1
addal %d1,%a1
andb #1,%d2
jbne L(white_8)
moveb #0xff,%a1@
jbra L(console_plot_pixel_exit)
L(white_8):
clrb %a1@
jbra L(console_plot_pixel_exit)
L(test_16bit):
cmpb #16,%d3
jbne L(console_plot_pixel_exit)
addal %d0,%a1
addal %d0,%a1
addal %d1,%a1
andb #1,%d2
jbne L(white_16)
clrw %a1@
jbra L(console_plot_pixel_exit)
L(white_16):
movew #0x0fff,%a1@
jbra L(console_plot_pixel_exit)
L(console_plot_pixel_exit):
func_return console_plot_pixel
#endif
__INITDATA
.align 4
m68k_init_mapped_size:
.long 0
#if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || \
defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
L(custom):
L(iobase):
.long 0
#endif
#ifdef CONSOLE_DEBUG
L(console_globals):
.long 0
.long 0
.long 0
.long 0
.long 0
L(console_font):
.long 0
L(console_font_data):
.long 0
#endif
#if defined(MMU_PRINT)
L(mmu_print_data):
.long 0
.long 0
.long 0
.long 0
.long 0
#endif
L(cputype):
.long 0
L(mmu_cached_pointer_tables):
.long 0
L(mmu_num_pointer_tables):
.long 0
L(phys_kernel_start):
.long 0
L(kernel_end):
.long 0
L(memory_start):
.long 0
L(kernel_pgdir_ptr):
.long 0
L(temp_mmap_mem):
.long 0
#if defined (CONFIG_MVME147)
M147_SCC_CTRL_A = 0xfffe3002
M147_SCC_DATA_A = 0xfffe3003
#endif
#if defined (CONFIG_MVME16x)
M162_SCC_CTRL_A = 0xfff45005
M167_CYCAR = 0xfff450ee
M167_CYIER = 0xfff45011
M167_CYLICR = 0xfff45026
M167_CYTEOIR = 0xfff45085
M167_CYTDR = 0xfff450f8
M167_PCSCCMICR = 0xfff4201d
M167_PCSCCTICR = 0xfff4201e
M167_PCSCCRICR = 0xfff4201f
M167_PCTPIACKR = 0xfff42025
#endif
#if defined (CONFIG_BVME6000)
BVME_SCC_CTRL_A = 0xffb0000b
BVME_SCC_DATA_A = 0xffb0000f
#endif
#if defined(CONFIG_MAC)
L(mac_videobase):
.long 0
L(mac_videodepth):
.long 0
L(mac_dimensions):
.long 0
L(mac_rowbytes):
.long 0
L(mac_sccbase):
.long 0
#endif
#if defined (CONFIG_APOLLO)
LSRB0 = 0x10412
LTHRB0 = 0x10416
LCPUCTRL = 0x10100
#endif
#if defined(CONFIG_HP300)
DCADATA = 0x11
DCALSR = 0x1b
APCIDATA = 0x00
APCILSR = 0x14
L(uartbase):
.long 0
L(uart_scode):
.long -1
#endif
__FINIT
.data
.align 4
availmem:
.long 0
m68k_pgtable_cachemode:
.long 0
m68k_supervisor_cachemode:
.long 0
#if defined(CONFIG_MVME16x)
mvme_bdid:
.long 0,0,0,0,0,0,0,0
#endif
#if defined(CONFIG_Q40)
q40_mem_cptr:
.long 0
L(q40_do_debug):
.long 0
#endif
#if defined(CONFIG_VIRT)
GF_PUT_CHAR = 0x00
L(virt_gf_tty_base):
.long 0
#endif