cc -E  -x assembler-with-cpp -traditional-cpp -D_LOCORE  -Dpc98 -I.  -I../../../../arch -I../../../.. -nostdinc -DDIAGNOSTIC -DDEBUG -DMAXUSERS=8 -D_KERNEL -D_KERNEL_OPT -c ../../../../arch/pc98/pc98/locore.S
# 1 "../../../../arch/pc98/pc98/locore.S"























































































# 1 "opt_cputype.h" 1




# 88 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_ddb.h" 1

# 89 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_ipkdb.h" 1







# 90 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_vm86.h" 1

# 91 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_user_ldt.h" 1

# 92 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_dummy_nops.h" 1

# 93 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_compat_oldboot.h" 1

# 94 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_multiprocessor.h" 1

# 95 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_lockdebug.h" 1

# 96 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "opt_realmem.h" 1


# 97 "../../../../arch/pc98/pc98/locore.S" 2


# 1 "npx.h" 1

# 99 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "assym.h" 1








































































































# 100 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "apm.h" 1

# 101 "../../../../arch/pc98/pc98/locore.S" 2


# 1 "../../../../sys/errno.h" 1
























































					






















































































































































# 103 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "../../../../sys/syscall.h" 1









































				



































































































				






















































				
				




















				
				








































































				














				









				






















































				




























				






















				


				


				












				





















				
				
				
				



























































				
				
				
				
				
				
				
				
				
				











				
				
				
				











				
				
				
				











				
				
				
				














































































				







































				



				



				





























# 104 "../../../../arch/pc98/pc98/locore.S" 2


# 1 "machine/bootinfo.h" 1


































# 135 "machine/bootinfo.h"





# 106 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/cputypes.h" 1


# 1 "i386/cputypes.h" 1
















































































# 3 "machine/cputypes.h" 2

# 107 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/frameasm.h" 1


# 1 "i386/frameasm.h" 1






# 1 "opt_multiprocessor.h" 1

# 7 "i386/frameasm.h" 2





# 42 "i386/frameasm.h"

		




# 67 "i386/frameasm.h"


# 82 "i386/frameasm.h"





# 3 "machine/frameasm.h" 2

# 108 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/param.h" 1










































# 1 "machine/psl.h" 1


# 1 "i386/psl.h" 1





































































# 1 "opt_vm86.h" 1

# 70 "i386/psl.h" 2









# 1 "machine/intr.h" 1









































# 1 "machine/intrdefs.h" 1

























































































# 42 "machine/intr.h" 2


# 268 "machine/intr.h"











# 329 "machine/intr.h"



# 79 "i386/psl.h" 2




# 3 "machine/psl.h" 2

# 43 "machine/param.h" 2












# 1 "i386/param.h" 1

















































# 1 "machine/psl.h" 1



# 50 "i386/param.h" 2






















































# 1 "opt_noredzone.h" 1

# 104 "i386/param.h" 2
























					






# 1 "opt_gateway.h" 1

# 135 "i386/param.h" 2

























































# 55 "machine/param.h" 2

# 109 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/pte.h" 1


# 1 "i386/pte.h" 1

































































































































# 139 "i386/pte.h"
























































# 3 "machine/pte.h" 2

# 110 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/segments.h" 1


# 1 "i386/segments.h" 1
























































	
	


	





# 1 "opt_vm86.h" 1

# 67 "i386/segments.h" 2











# 151 "i386/segments.h"

























































































































# 3 "machine/segments.h" 2

# 111 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/specialreg.h" 1


# 1 "i386/specialreg.h" 1




























































































































































































































































































































































































































































































































































































# 3 "machine/specialreg.h" 2

# 112 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/sysinfo.h" 1










































































































# 122 "machine/sysinfo.h"



# 113 "../../../../arch/pc98/pc98/locore.S" 2

# 1 "machine/trap.h" 1


# 1 "i386/trap.h" 1










































































# 3 "machine/trap.h" 2

# 114 "../../../../arch/pc98/pc98/locore.S" 2


















# 1 "machine/asm.h" 1


# 1 "i386/asm.h" 1












































# 1 "opt_multiprocessor.h" 1

# 45 "i386/asm.h" 2



# 60 "i386/asm.h"





















































 
























# 146 "i386/asm.h"













































# 3 "machine/asm.h" 2

# 132 "../../../../arch/pc98/pc98/locore.S" 2
























# 1 "../../../../arch/pc98/cbus/cbusreg.h" 1
































































		










































































# 156 "../../../../arch/pc98/pc98/locore.S" 2









	.set	PTmap,(767 << 22)
	.set	PTD,(PTmap + 767 * (1 << 12))
	.set	PTDpde,(PTD + 767 * 4)







	.set	APTmap,(1023 << 22)
	.set	APTD,(APTmap + 1023 * (1 << 12))
	.set	APTDpde,(PTD + 1023 * 4)





	.data

	.globl	cpu,cpu_id,cpu_vendor
	.globl	cpuid_level,cpu_feature
	.globl	cpu_brand_id
	.globl	esym,boothowto
	.globl	bootinfo,atdevbase
	.globl	system_parameter



	.globl	proc0paddr,curpcb,PTDpaddr
	.globl	biosbasemem,biosextmem
	.globl	gdt

	.globl	idt

cpu:		.long	0	# are we 386, 386sx, or 486,
					#   or Pentium, or..
cpu_id:	.long	0	# saved from `cpuid' instruction
cpu_feature:	.long	0	# feature flags from 'cpuid'
					#   instruction
cpuid_level:	.long	-1	# max. level accepted by 'cpuid'
					#   instruction
cpu_vendor:	.space	16	# vendor string returned by `cpuid'
					#   instruction
cpu_brand_id:	.long	0	# brand ID from 'cpuid' instruction
esym:		.long	0	# ptr to end of syms
atdevbase:	.long	0	# location of start of iomem in virtual
proc0paddr:	.long	0
PTDpaddr:	.long	0	# paddr of PTD, for libkvm

biosbasemem:	.long	0	# base memory reported by BIOS




biosextmem:	.long	0	# extended memory reported by BIOS



	
	.space 512
tmpstk:





	.text
	.globl	kernel_text
	.set	kernel_text,(0xc0000000 + 0x100000)

	.globl	start

start:  movl    $-1,%eax
        outb    %al,$0x02
        outb    %al,$0x0a
        movl    $((system_parameter) - 0xc0000000),%edi
        movl    $0x400,%esi
        movl    $0x600,%ecx
        cld
        rep
        movsb

	



	movl	4(%esp),%eax
	movl	%eax,((boothowto) - 0xc0000000)




	movl	12(%esp),%eax

	testl	%eax, %eax
	jz	1f
	movl	(%eax), %ebx		
	movl	$((bootinfo) - 0xc0000000), %edx
	movl	%ebx, (%edx)
	addl	$4, %edx
2:
	testl	%ebx, %ebx
	jz	1f
	addl	$4, %eax
	movl	(%eax), %ecx		
	pushl	%eax
	pushl	(%ecx)		
	pushl	%edx
	addl	(%ecx), %edx		
	cmpl	$((bootinfo + 4096) - 0xc0000000), %edx
	jg	2f
	pushl	%ecx
	call	bcopy
	addl	$12, %esp
	popl	%eax
	subl	$1, %ebx
	jmp	2b
2:	
	addl	$12, %esp
	movl	$((bootinfo) - 0xc0000000), %edx
	subl	%ebx, (%edx)		
1:

 	movl	16(%esp),%eax
	testl	%eax,%eax
	jz	1f
	addl	$0xc0000000,%eax
1: 	movl	%eax,((esym) - 0xc0000000)

	
	pushl	$0x00000002
	popfl

	

try386:	
	pushfl
	popl	%eax
	movl	%eax,%ecx
	orl	$0x00040000,%eax
	pushl	%eax
	popfl
	pushfl
	popl	%eax
	xorl	%ecx,%eax
	andl	$0x00040000,%eax
	pushl	%ecx
	popfl

	testl	%eax,%eax
	jnz	try486

	




	movl	$0x5555,%eax
	xorl	%edx,%edx
	movl	$2,%ecx
	divl	%ecx
	jnz	is386

isnx586:
	



	movl	$6,((cpu) - 0xc0000000)
	jmp	2f

is386:
	movl	$1,((cpu) - 0xc0000000)
	jmp	2f

try486:	
	pushfl
	popl	%eax
	movl	%eax,%ecx
	xorl	$0x00200000,%eax
	pushl	%eax
	popfl
	pushfl
	popl	%eax
	xorl	%ecx,%eax
	andl	$0x00200000,%eax
	pushl	%ecx
	popfl

	testl	%eax,%eax
	jnz	try586
is486:	movl	$3,((cpu) - 0xc0000000)

	


	movl	$0x5555,%eax
	xorl	%edx,%edx
	movl	$2,%ecx
	clc
	divl	%ecx
	jnc	11f
	jmp	13f

11:
	



	xorl	%edx,%edx
	cmpl	%edx,%edx		# set flags to known state
	pushfl
	popl	%ecx			# store flags in ecx
	movl	$-1,%eax
	movl	$4,%ebx
	divl	%ebx			# do a long division
	pushfl
	popl	%eax
	xorl	%ecx,%eax		# are the flags different?
	testl	$0x8d5,%eax		# only check C|PF|AF|Z|N|V

	movl	$4,%eax
	je	12f
	movl	$CPU_5x86,%eax		#hlt	# movl	$CPU_5x86,%eax
12:	clc
13:	jc	2f

	movl	%eax,((cpu) - 0xc0000000)			# set CPU type
	movl	$0x69727943,((cpu_vendor) - 0xc0000000)	# store vendor string
	movb	$0x78,((cpu_vendor) - 0xc0000000)+4
	jmp	2f

try586:	
	xorl	%eax,%eax
	cpuid
	movl	%eax,((cpuid_level) - 0xc0000000)
	movl	%ebx,((cpu_vendor) - 0xc0000000)	# store vendor string
	movl	%edx,((cpu_vendor) - 0xc0000000)+4
	movl	%ecx,((cpu_vendor) - 0xc0000000)+8
	movl	$0,  ((cpu_vendor) - 0xc0000000)+12

	movl	$1,%eax
	cpuid
	movl	%eax,((cpu_id) - 0xc0000000)	# store cpu_id and features
	movl	%edx,((cpu_feature) - 0xc0000000)

	
	andl	$255,%ebx
	movl	%ebx,((cpu_brand_id) - 0xc0000000)

2:
	











	movl	$((tmpstk) - 0xc0000000),%esp	# bootstrap stack end location












	
	movl	$((end) - 0xc0000000),%edi

	
	movl	((esym) - 0xc0000000),%eax
	testl	%eax,%eax
	jz	1f
	subl	$0xc0000000,%eax
	movl	%eax,%edi
1:


	
	movl	%edi,%esi			# edi = esym ? esym : end
	addl	$((1 << 12)-1),%esi			# page align up
	andl	$~((1 << 12)-1),%esi

	



	movl	((nkpde) - 0xc0000000),%ecx		# get nkpde
	cmpl	$4,%ecx			# larger than min?
	jge	1f
	movl	$4,%ecx			# set at min
	jmp	2f
1:	cmpl	$255,%ecx			# larger than max?
	jle	2f
	movl	$255,%ecx
2:

	
	shll	$12,%ecx
	addl	$((1+4) * (1 << 12)),%ecx
	addl	%esi,%ecx			# end of tables
	subl	%edi,%ecx			# size of tables
	shrl	$2,%ecx
	xorl	%eax,%eax
	cld
	rep
	stosl
















	
	leal	(((etext) - 0xc0000000)+((1 << 12)-1)),%edx
	andl	$~((1 << 12)-1),%edx
	
	
	movl	$(((0xc0000000 + 0x100000)) - 0xc0000000),%eax
	movl	%eax,%ecx
	shrl	$12,%ecx
	leal	(((1+4)       * (1 << 12)))(%esi,%ecx,4),%ebx

	
	movl	%edx,%ecx
	subl	%eax,%ecx
	shrl	$12,%ecx
	orl	$(0x00000001|0x00000000),%eax
	1:	movl	%eax,(%ebx)	; addl	$(1 << 12),%eax	;  addl	$4,%ebx		;  loop	1b		;

	
	leal	(0x00000001|0x00000002)(%edx),%eax
	movl	((nkpde) - 0xc0000000),%ecx
	shll	$12,%ecx
	addl	$((1+4) * (1 << 12)),%ecx
	addl	%esi,%ecx				# end of tables
	subl	%edx,%ecx				# subtract end of text
	shrl	$12,%ecx
	1:	movl	%eax,(%ebx)	; addl	$(1 << 12),%eax	;  addl	$4,%ebx		;  loop	1b		;

	
	movl	$(0x0a0000|0x00000001|0x00000002),%eax	# having these bits set
	movl	$((0x100000 - 0x0a0000)>>12),%ecx		# for this many pte s,
	1:	movl	%eax,(%ebx)	; addl	$(1 << 12),%eax	;  addl	$4,%ebx		;  loop	1b		;




	
	movl	((nkpde) - 0xc0000000),%ecx			# for this many pde s,
	leal	(((0)              * (1 << 12))+0*4)(%esi),%ebx		# which is where temp maps!
	leal	(((1+4)       * (1 << 12))+0x00000001|0x00000002)(%esi),%eax		# pte for KPT in proc 0,
	1:	movl	%eax,(%ebx)	; addl	$(1 << 12),%eax	;  addl	$4,%ebx		;  loop	1b		;

	
	movl	((nkpde) - 0xc0000000),%ecx			# for this many pde s,
	leal	(((0)              * (1 << 12))+768*4)(%esi),%ebx	# kernel pde offset
	leal	(((1+4)       * (1 << 12))+0x00000001|0x00000002)(%esi),%eax		# pte for KPT in proc 0,
	1:	movl	%eax,(%ebx)	; addl	$(1 << 12),%eax	;  addl	$4,%ebx		;  loop	1b		;

	
	leal	(((0)              * (1 << 12))+0x00000001|0x00000002)(%esi),%eax	# pte for ptd
	movl	%eax,(((0)              * (1 << 12))+767*4)(%esi)	# recursive PD slot

	
	movl	%esi,((PTDpaddr) - 0xc0000000)

	
	movl	%esi,%eax		# phys address of ptd in proc 0
	movl	%eax,%cr3		# load ptd addr into mmu
	movl	%cr0,%eax		# get control word
					# enable paging & NPX emulation
	orl	$(0x00000001|0x80000000|0x00000020|0x00000008|0x00000004|0x00000002),%eax
	movl	%eax,%cr0		# and let's page NOW!

	pushl	$begin			# jump to high mem
	ret

begin:
	
	movl	nkpde,%ecx		# for this many pde s,
	leal	(((0)              * (1 << 12))+0*4)(%esi),%ebx	# which is where temp maps!
	addl	$(0xc0000000), %ebx	# now use relocated address
1:	movl	$0,(%ebx)
	addl	$4,%ebx	# next pde
	loop	1b

	
	movl	nkpde,%edx
	shll	$12,%edx
	addl	$(((1+4) * (1 << 12))+0xc0000000),%edx
	addl	%esi,%edx
	movl	%edx,atdevbase

	
	leal	(((1)              * (1 << 12))+0xc0000000)(%esi),%eax
	movl	%eax,proc0paddr
	leal	((4 * (1 << 12))-88)(%eax),%esp
	movl	%esi,28(%eax)	# pcb->pcb_cr3
	xorl	%ebp,%ebp               # mark end of frames

	movl	nkpde,%eax
	shll	$12,%eax
	addl	$((1+4) * (1 << 12)),%eax
	addl	%esi,%eax		# skip past stack and page tables
	pushl	%eax
	call	init386	# wire 386 chip for unix operation
	addl	$4,%esp

	
	xorl	%ecx,%ecx
	mov	%cx,%fs
	mov	%cx,%gs

	call 	main









.text; .align	4,0x90; .globl probeintr; .type probeintr,@function; probeintr:
	ss
	incl	npx_intrs_while_probing
	pushl	%eax
	movb	$0x20,%al	# EOI (asm in strings loses cpp features)
	outb	%al,$0x08	# 0x008
	outb	%al,$0x00	# 0x000
	movb	$0,%al
	outb	%al,$0xf8	# clear BUSY# latch
	popl	%eax
	iret



.text; .align	4,0x90; .globl flush_cache; .type flush_cache,@function; flush_cache:
	invd
	ret


.text; .align	4,0x90; .globl flush_wbcache; .type flush_wbcache,@function; flush_wbcache:
	wbinvd
	ret

# 1 "../../../../arch/pc98/pc98/busio.S" 1





































# 1 "machine/asm.h" 1



# 38 "../../../../arch/pc98/pc98/busio.S" 2













.text; .align	4,0x90; .globl SBUS_DA_io_space_read_1; .type SBUS_DA_io_space_read_1,@function; SBUS_DA_io_space_read_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	inb	%dx,%al
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_read_2; .type SBUS_DA_io_space_read_2,@function; SBUS_DA_io_space_read_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	inw	%dx,%ax
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_read_4; .type SBUS_DA_io_space_read_4,@function; SBUS_DA_io_space_read_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	inl	%dx,%eax
	ret






.text; .align	4,0x90; .globl SBUS_DA_io_space_write_1; .type SBUS_DA_io_space_write_1,@function; SBUS_DA_io_space_write_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	outb	%al,%dx
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_write_2; .type SBUS_DA_io_space_write_2,@function; SBUS_DA_io_space_write_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	outw	%ax,%dx
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_write_4; .type SBUS_DA_io_space_write_4,@function; SBUS_DA_io_space_write_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	outl	%eax,%dx
	ret







.text; .align	4,0x90; .globl SBUS_DA_io_space_read_multi_1; .type SBUS_DA_io_space_read_multi_1,@function; SBUS_DA_io_space_read_multi_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	rep
	insb
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_read_multi_2; .type SBUS_DA_io_space_read_multi_2,@function; SBUS_DA_io_space_read_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	rep
	insw
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_read_multi_4; .type SBUS_DA_io_space_read_multi_4,@function; SBUS_DA_io_space_read_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	rep
	insl
	ret







.text; .align	4,0x90; .globl SBUS_DA_io_space_write_multi_1; .type SBUS_DA_io_space_write_multi_1,@function; SBUS_DA_io_space_write_multi_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	rep
	outsb
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_write_multi_2; .type SBUS_DA_io_space_write_multi_2,@function; SBUS_DA_io_space_write_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	rep
	outsw
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_write_multi_4; .type SBUS_DA_io_space_write_multi_4,@function; SBUS_DA_io_space_write_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	rep
	outsl
	ret







.text; .align	4,0x90; .globl SBUS_DA_io_space_read_region_1; .type SBUS_DA_io_space_read_region_1,@function; SBUS_DA_io_space_read_region_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	inb	%dx,%al
	stosb
	incl	%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_read_region_2; .type SBUS_DA_io_space_read_region_2,@function; SBUS_DA_io_space_read_region_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	inw	%dx,%ax
	stosw
	addl	$2,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_read_region_4; .type SBUS_DA_io_space_read_region_4,@function; SBUS_DA_io_space_read_region_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	inl	%dx,%eax
	stosl
	addl	$4,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret







.text; .align	4,0x90; .globl SBUS_DA_io_space_write_region_1; .type SBUS_DA_io_space_write_region_1,@function; SBUS_DA_io_space_write_region_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsb
	outb	%al,%dx
	incl	%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret	

.text; .align	4,0x90; .globl SBUS_DA_io_space_write_region_2; .type SBUS_DA_io_space_write_region_2,@function; SBUS_DA_io_space_write_region_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsw
	outw	%ax,%dx
	addl	$2,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret	

.text; .align	4,0x90; .globl SBUS_DA_io_space_write_region_4; .type SBUS_DA_io_space_write_region_4,@function; SBUS_DA_io_space_write_region_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsl
	outl	%eax,%dx
	addl	$4,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret	







.text; .align	4,0x90; .globl SBUS_DA_io_space_set_multi_1; .type SBUS_DA_io_space_set_multi_1,@function; SBUS_DA_io_space_set_multi_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	outb	%al,%dx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_set_multi_2; .type SBUS_DA_io_space_set_multi_2,@function; SBUS_DA_io_space_set_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	outw	%ax,%dx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_set_multi_4; .type SBUS_DA_io_space_set_multi_4,@function; SBUS_DA_io_space_set_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	outl	%eax,%dx
	decl	%ecx
	jnz	1b
2:
	ret







.text; .align	4,0x90; .globl SBUS_DA_io_space_set_region_1; .type SBUS_DA_io_space_set_region_1,@function; SBUS_DA_io_space_set_region_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	outb	%al,%dx
	incl	%edx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_set_region_2; .type SBUS_DA_io_space_set_region_2,@function; SBUS_DA_io_space_set_region_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	outw	%ax,%dx
	addl	$2,%edx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_set_region_4; .type SBUS_DA_io_space_set_region_4,@function; SBUS_DA_io_space_set_region_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	outl	%eax,%dx
	addl	$4,%edx
	decl	%ecx
	jnz	1b
2:
	ret







.text; .align	4,0x90; .globl SBUS_DA_io_space_copy_region_1; .type SBUS_DA_io_space_copy_region_1,@function; SBUS_DA_io_space_copy_region_1:
	addl BUS_SPACE_HANDLE_BASE(%eax),%esi
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edi
	pushl	%eax
	pushl	%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%esi,%edx
	inb	%dx,%al
	incl	%esi

	movl	%edi,%edx
	outb	%al,%dx
	incl	%edi

	decl	%ecx
	jnz	1b
2:
	popl	%edx
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_copy_region_2; .type SBUS_DA_io_space_copy_region_2,@function; SBUS_DA_io_space_copy_region_2:
	addl BUS_SPACE_HANDLE_BASE(%eax),%esi
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edi
	pushl	%eax
	pushl	%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%esi,%edx
	inw	%dx,%ax
	addl	$2,%esi

	movl	%edi,%edx
	outw	%ax,%dx
	addl	$2,%edi

	decl	%ecx
	jnz	1b
2:
	popl	%edx
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_io_space_copy_region_4; .type SBUS_DA_io_space_copy_region_4,@function; SBUS_DA_io_space_copy_region_4:
	addl BUS_SPACE_HANDLE_BASE(%eax),%esi
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edi
	pushl	%eax
	pushl	%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%esi,%edx
	inl	%dx,%eax
	addl	$4,%esi

	movl	%edi,%edx
	outl	%eax,%dx
	addl	$4,%edi

	decl	%ecx
	jnz	1b
2:
	popl	%edx
	popl	%eax
	ret







.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_1; .type SBUS_DA_mem_space_read_1,@function; SBUS_DA_mem_space_read_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	movb	(%edx),%al
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_2; .type SBUS_DA_mem_space_read_2,@function; SBUS_DA_mem_space_read_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	movw	(%edx),%ax
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_4; .type SBUS_DA_mem_space_read_4,@function; SBUS_DA_mem_space_read_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	movl	(%edx),%eax
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_1; .type SBUS_DA_mem_space_write_1,@function; SBUS_DA_mem_space_write_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	movb	%al,(%edx)
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_2; .type SBUS_DA_mem_space_write_2,@function; SBUS_DA_mem_space_write_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	movw	%ax,(%edx)
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_4; .type SBUS_DA_mem_space_write_4,@function; SBUS_DA_mem_space_write_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	movl	%eax,(%edx)
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_multi_1; .type SBUS_DA_mem_space_read_multi_1,@function; SBUS_DA_mem_space_read_multi_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	movb	(%edx),%al
	stosb
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_multi_2; .type SBUS_DA_mem_space_read_multi_2,@function; SBUS_DA_mem_space_read_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	movw	(%edx),%ax	
	stosw
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_multi_4; .type SBUS_DA_mem_space_read_multi_4,@function; SBUS_DA_mem_space_read_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	movl	(%edx),%eax	
	stosl
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_multi_1; .type SBUS_DA_mem_space_write_multi_1,@function; SBUS_DA_mem_space_write_multi_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsb
	movb	%al,(%edx)
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_multi_2; .type SBUS_DA_mem_space_write_multi_2,@function; SBUS_DA_mem_space_write_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsw
	movw	%ax,(%edx)
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_multi_4; .type SBUS_DA_mem_space_write_multi_4,@function; SBUS_DA_mem_space_write_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsl
	movl	%eax,(%edx)
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_region_1; .type SBUS_DA_mem_space_read_region_1,@function; SBUS_DA_mem_space_read_region_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%esi
	movl	%edx,%esi
	rep
	movsb
	popl	%esi
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_region_2; .type SBUS_DA_mem_space_read_region_2,@function; SBUS_DA_mem_space_read_region_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%esi
	movl	%edx,%esi
	rep
	movsw
	popl	%esi
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_read_region_4; .type SBUS_DA_mem_space_read_region_4,@function; SBUS_DA_mem_space_read_region_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%esi
	movl	%edx,%esi
	rep
	movsl
	popl	%esi
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_region_1; .type SBUS_DA_mem_space_write_region_1,@function; SBUS_DA_mem_space_write_region_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	movsb
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_region_2; .type SBUS_DA_mem_space_write_region_2,@function; SBUS_DA_mem_space_write_region_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	movsw
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_write_region_4; .type SBUS_DA_mem_space_write_region_4,@function; SBUS_DA_mem_space_write_region_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	movsl
	popl	%edi
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_set_multi_1; .type SBUS_DA_mem_space_set_multi_1,@function; SBUS_DA_mem_space_set_multi_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movb	%al,(%edx)
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_set_multi_2; .type SBUS_DA_mem_space_set_multi_2,@function; SBUS_DA_mem_space_set_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movw	%ax,(%edx)
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_set_multi_4; .type SBUS_DA_mem_space_set_multi_4,@function; SBUS_DA_mem_space_set_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%eax,(%edx)
	decl	%ecx
	jnz	1b
2:
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_set_region_1; .type SBUS_DA_mem_space_set_region_1,@function; SBUS_DA_mem_space_set_region_1:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	stosb
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_set_region_2; .type SBUS_DA_mem_space_set_region_2,@function; SBUS_DA_mem_space_set_region_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	stosw
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_set_region_4; .type SBUS_DA_mem_space_set_region_4,@function; SBUS_DA_mem_space_set_region_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	stosl
	popl	%edi
	ret




.text; .align	4,0x90; .globl SBUS_DA_mem_space_copy_region_1; .type SBUS_DA_mem_space_copy_region_1,@function; SBUS_DA_mem_space_copy_region_1:
	addl BUS_SPACE_HANDLE_BASE(%eax),%esi
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edi
	cld
	rep
	movsb
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_copy_region_2; .type SBUS_DA_mem_space_copy_region_2,@function; SBUS_DA_mem_space_copy_region_2:
	addl BUS_SPACE_HANDLE_BASE(%eax),%esi
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edi
	cld
	rep
	movsw
	ret

.text; .align	4,0x90; .globl SBUS_DA_mem_space_copy_region_4; .type SBUS_DA_mem_space_copy_region_4,@function; SBUS_DA_mem_space_copy_region_4:
	addl BUS_SPACE_HANDLE_BASE(%eax),%esi
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edi
	cld
	rep
	movsl
	ret














.text; .align	4,0x90; .globl SBUS_RA_io_space_read_1; .type SBUS_RA_io_space_read_1,@function; SBUS_RA_io_space_read_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	inb	%dx,%al
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_read_2; .type SBUS_RA_io_space_read_2,@function; SBUS_RA_io_space_read_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	inw	%dx,%ax
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_read_4; .type SBUS_RA_io_space_read_4,@function; SBUS_RA_io_space_read_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	inl	%dx,%eax
	ret






.text; .align	4,0x90; .globl SBUS_RA_io_space_write_1; .type SBUS_RA_io_space_write_1,@function; SBUS_RA_io_space_write_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	outb	%al,%dx
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_write_2; .type SBUS_RA_io_space_write_2,@function; SBUS_RA_io_space_write_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	outw	%ax,%dx
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_write_4; .type SBUS_RA_io_space_write_4,@function; SBUS_RA_io_space_write_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	outl	%eax,%dx
	ret







.text; .align	4,0x90; .globl SBUS_RA_io_space_read_multi_1; .type SBUS_RA_io_space_read_multi_1,@function; SBUS_RA_io_space_read_multi_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	rep
	insb
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_read_multi_2; .type SBUS_RA_io_space_read_multi_2,@function; SBUS_RA_io_space_read_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	rep
	insw
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_read_multi_4; .type SBUS_RA_io_space_read_multi_4,@function; SBUS_RA_io_space_read_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	rep
	insl
	ret







.text; .align	4,0x90; .globl SBUS_RA_io_space_write_multi_1; .type SBUS_RA_io_space_write_multi_1,@function; SBUS_RA_io_space_write_multi_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	rep
	outsb
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_write_multi_2; .type SBUS_RA_io_space_write_multi_2,@function; SBUS_RA_io_space_write_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	rep
	outsw
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_write_multi_4; .type SBUS_RA_io_space_write_multi_4,@function; SBUS_RA_io_space_write_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	rep
	outsl
	ret







.text; .align	4,0x90; .globl SBUS_RA_io_space_read_region_1; .type SBUS_RA_io_space_read_region_1,@function; SBUS_RA_io_space_read_region_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	inb	%dx,%al
	stosb
	incl	%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_read_region_2; .type SBUS_RA_io_space_read_region_2,@function; SBUS_RA_io_space_read_region_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	inw	%dx,%ax
	stosw
	addl	$2,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_read_region_4; .type SBUS_RA_io_space_read_region_4,@function; SBUS_RA_io_space_read_region_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	inl	%dx,%eax
	stosl
	addl	$4,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret







.text; .align	4,0x90; .globl SBUS_RA_io_space_write_region_1; .type SBUS_RA_io_space_write_region_1,@function; SBUS_RA_io_space_write_region_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsb
	outb	%al,%dx
	incl	%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret	

.text; .align	4,0x90; .globl SBUS_RA_io_space_write_region_2; .type SBUS_RA_io_space_write_region_2,@function; SBUS_RA_io_space_write_region_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsw
	outw	%ax,%dx
	addl	$2,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret	

.text; .align	4,0x90; .globl SBUS_RA_io_space_write_region_4; .type SBUS_RA_io_space_write_region_4,@function; SBUS_RA_io_space_write_region_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsl
	outl	%eax,%dx
	addl	$4,%edx
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret	







.text; .align	4,0x90; .globl SBUS_RA_io_space_set_multi_1; .type SBUS_RA_io_space_set_multi_1,@function; SBUS_RA_io_space_set_multi_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	outb	%al,%dx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_set_multi_2; .type SBUS_RA_io_space_set_multi_2,@function; SBUS_RA_io_space_set_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	outw	%ax,%dx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_set_multi_4; .type SBUS_RA_io_space_set_multi_4,@function; SBUS_RA_io_space_set_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	outl	%eax,%dx
	decl	%ecx
	jnz	1b
2:
	ret







.text; .align	4,0x90; .globl SBUS_RA_io_space_set_region_1; .type SBUS_RA_io_space_set_region_1,@function; SBUS_RA_io_space_set_region_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	outb	%al,%dx
	incl	%edx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_set_region_2; .type SBUS_RA_io_space_set_region_2,@function; SBUS_RA_io_space_set_region_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	outw	%ax,%dx
	addl	$2,%edx
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_set_region_4; .type SBUS_RA_io_space_set_region_4,@function; SBUS_RA_io_space_set_region_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	outl	%eax,%dx
	addl	$4,%edx
	decl	%ecx
	jnz	1b
2:
	ret







.text; .align	4,0x90; .globl SBUS_RA_io_space_copy_region_1; .type SBUS_RA_io_space_copy_region_1,@function; SBUS_RA_io_space_copy_region_1:
	movl BUS_SPACE_HANDLE_IAT(%eax, %esi, 4), %esi
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edi, 4), %edi
	pushl	%eax
	pushl	%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%esi,%edx
	inb	%dx,%al
	incl	%esi

	movl	%edi,%edx
	outb	%al,%dx
	incl	%edi

	decl	%ecx
	jnz	1b
2:
	popl	%edx
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_copy_region_2; .type SBUS_RA_io_space_copy_region_2,@function; SBUS_RA_io_space_copy_region_2:
	movl BUS_SPACE_HANDLE_IAT(%eax, %esi, 4), %esi
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edi, 4), %edi
	pushl	%eax
	pushl	%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%esi,%edx
	inw	%dx,%ax
	addl	$2,%esi

	movl	%edi,%edx
	outw	%ax,%dx
	addl	$2,%edi

	decl	%ecx
	jnz	1b
2:
	popl	%edx
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_io_space_copy_region_4; .type SBUS_RA_io_space_copy_region_4,@function; SBUS_RA_io_space_copy_region_4:
	movl BUS_SPACE_HANDLE_IAT(%eax, %esi, 4), %esi
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edi, 4), %edi
	pushl	%eax
	pushl	%edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%esi,%edx
	inl	%dx,%eax
	addl	$4,%esi

	movl	%edi,%edx
	outl	%eax,%dx
	addl	$4,%edi

	decl	%ecx
	jnz	1b
2:
	popl	%edx
	popl	%eax
	ret







.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_1; .type SBUS_RA_mem_space_read_1,@function; SBUS_RA_mem_space_read_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	movb	(%edx),%al
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_2; .type SBUS_RA_mem_space_read_2,@function; SBUS_RA_mem_space_read_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	movw	(%edx),%ax
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_4; .type SBUS_RA_mem_space_read_4,@function; SBUS_RA_mem_space_read_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	movl	(%edx),%eax
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_1; .type SBUS_RA_mem_space_write_1,@function; SBUS_RA_mem_space_write_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	movb	%al,(%edx)
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_2; .type SBUS_RA_mem_space_write_2,@function; SBUS_RA_mem_space_write_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	movw	%ax,(%edx)
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_4; .type SBUS_RA_mem_space_write_4,@function; SBUS_RA_mem_space_write_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	movl	%eax,(%edx)
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_multi_1; .type SBUS_RA_mem_space_read_multi_1,@function; SBUS_RA_mem_space_read_multi_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	movb	(%edx),%al
	stosb
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_multi_2; .type SBUS_RA_mem_space_read_multi_2,@function; SBUS_RA_mem_space_read_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	movw	(%edx),%ax	
	stosw
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_multi_4; .type SBUS_RA_mem_space_read_multi_4,@function; SBUS_RA_mem_space_read_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	movl	(%edx),%eax	
	stosl
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_multi_1; .type SBUS_RA_mem_space_write_multi_1,@function; SBUS_RA_mem_space_write_multi_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsb
	movb	%al,(%edx)
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_multi_2; .type SBUS_RA_mem_space_write_multi_2,@function; SBUS_RA_mem_space_write_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsw
	movw	%ax,(%edx)
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_multi_4; .type SBUS_RA_mem_space_write_multi_4,@function; SBUS_RA_mem_space_write_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%eax
	orl	%ecx,%ecx
	jz	2f
1:
	lodsl
	movl	%eax,(%edx)
	decl	%ecx
	jnz	1b
2:
	popl	%eax
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_region_1; .type SBUS_RA_mem_space_read_region_1,@function; SBUS_RA_mem_space_read_region_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%esi
	movl	%edx,%esi
	rep
	movsb
	popl	%esi
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_region_2; .type SBUS_RA_mem_space_read_region_2,@function; SBUS_RA_mem_space_read_region_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%esi
	movl	%edx,%esi
	rep
	movsw
	popl	%esi
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_read_region_4; .type SBUS_RA_mem_space_read_region_4,@function; SBUS_RA_mem_space_read_region_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%esi
	movl	%edx,%esi
	rep
	movsl
	popl	%esi
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_region_1; .type SBUS_RA_mem_space_write_region_1,@function; SBUS_RA_mem_space_write_region_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	movsb
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_region_2; .type SBUS_RA_mem_space_write_region_2,@function; SBUS_RA_mem_space_write_region_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	movsw
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_write_region_4; .type SBUS_RA_mem_space_write_region_4,@function; SBUS_RA_mem_space_write_region_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	movsl
	popl	%edi
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_set_multi_1; .type SBUS_RA_mem_space_set_multi_1,@function; SBUS_RA_mem_space_set_multi_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	movb	%al,(%edx)
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_set_multi_2; .type SBUS_RA_mem_space_set_multi_2,@function; SBUS_RA_mem_space_set_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	movw	%ax,(%edx)
	decl	%ecx
	jnz	1b
2:
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_set_multi_4; .type SBUS_RA_mem_space_set_multi_4,@function; SBUS_RA_mem_space_set_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	orl	%ecx,%ecx
	jz	2f
1:
	movl	%eax,(%edx)
	decl	%ecx
	jnz	1b
2:
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_set_region_1; .type SBUS_RA_mem_space_set_region_1,@function; SBUS_RA_mem_space_set_region_1:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	stosb
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_set_region_2; .type SBUS_RA_mem_space_set_region_2,@function; SBUS_RA_mem_space_set_region_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	stosw
	popl	%edi
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_set_region_4; .type SBUS_RA_mem_space_set_region_4,@function; SBUS_RA_mem_space_set_region_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	cld
	pushl	%edi
	movl	%edx,%edi
	rep
	stosl
	popl	%edi
	ret




.text; .align	4,0x90; .globl SBUS_RA_mem_space_copy_region_1; .type SBUS_RA_mem_space_copy_region_1,@function; SBUS_RA_mem_space_copy_region_1:
	movl BUS_SPACE_HANDLE_IAT(%eax, %esi, 4), %esi
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edi, 4), %edi
	cld
	rep
	movsb
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_copy_region_2; .type SBUS_RA_mem_space_copy_region_2,@function; SBUS_RA_mem_space_copy_region_2:
	movl BUS_SPACE_HANDLE_IAT(%eax, %esi, 4), %esi
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edi, 4), %edi
	cld
	rep
	movsw
	ret

.text; .align	4,0x90; .globl SBUS_RA_mem_space_copy_region_4; .type SBUS_RA_mem_space_copy_region_4,@function; SBUS_RA_mem_space_copy_region_4:
	movl BUS_SPACE_HANDLE_IAT(%eax, %esi, 4), %esi
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edi, 4), %edi
	cld
	rep
	movsl
	ret







# 1380 "../../../../arch/pc98/pc98/busio.S"


# 1390 "../../../../arch/pc98/pc98/busio.S"
	






.text; .align	4,0x90; .globl NEPC_DA_io_space_read_2; .type NEPC_DA_io_space_read_2,@function; NEPC_DA_io_space_read_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	inw	%dx,%ax
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret


.text; .align	4,0x90; .globl NEPC_DA_io_space_write_2; .type NEPC_DA_io_space_write_2,@function; NEPC_DA_io_space_write_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	outw	%ax,%dx
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_read_multi_2; .type NEPC_DA_io_space_read_multi_2,@function; NEPC_DA_io_space_read_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	insw
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_write_multi_2; .type NEPC_DA_io_space_write_multi_2,@function; NEPC_DA_io_space_write_multi_2:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	outsw
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_read_region_2; .type NEPC_DA_io_space_read_region_2,@function; NEPC_DA_io_space_read_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_read_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_write_region_2; .type NEPC_DA_io_space_write_region_2,@function; NEPC_DA_io_space_write_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_write_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_set_multi_2; .type NEPC_DA_io_space_set_multi_2,@function; NEPC_DA_io_space_set_multi_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_set_multi_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret


.text; .align	4,0x90; .globl NEPC_DA_io_space_set_region_2; .type NEPC_DA_io_space_set_region_2,@function; NEPC_DA_io_space_set_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_set_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_copy_region_2; .type NEPC_DA_io_space_copy_region_2,@function; NEPC_DA_io_space_copy_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_copy_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_read_4; .type NEPC_DA_io_space_read_4,@function; NEPC_DA_io_space_read_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	inl	%dx,%eax
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_write_4; .type NEPC_DA_io_space_write_4,@function; NEPC_DA_io_space_write_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	outl	%eax,%dx
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_read_multi_4; .type NEPC_DA_io_space_read_multi_4,@function; NEPC_DA_io_space_read_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	insl
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_write_multi_4; .type NEPC_DA_io_space_write_multi_4,@function; NEPC_DA_io_space_write_multi_4:
	addl BUS_SPACE_HANDLE_BASE(%ebx),%edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	outsl
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_read_region_4; .type NEPC_DA_io_space_read_region_4,@function; NEPC_DA_io_space_read_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_read_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_write_region_4; .type NEPC_DA_io_space_write_region_4,@function; NEPC_DA_io_space_write_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_write_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_set_multi_4; .type NEPC_DA_io_space_set_multi_4,@function; NEPC_DA_io_space_set_multi_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_set_multi_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret


.text; .align	4,0x90; .globl NEPC_DA_io_space_set_region_4; .type NEPC_DA_io_space_set_region_4,@function; NEPC_DA_io_space_set_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_set_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_DA_io_space_copy_region_4; .type NEPC_DA_io_space_copy_region_4,@function; NEPC_DA_io_space_copy_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_DA_io_space_copy_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret










.text; .align	4,0x90; .globl NEPC_RA_io_space_read_2; .type NEPC_RA_io_space_read_2,@function; NEPC_RA_io_space_read_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	inw	%dx,%ax
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret


.text; .align	4,0x90; .globl NEPC_RA_io_space_write_2; .type NEPC_RA_io_space_write_2,@function; NEPC_RA_io_space_write_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	outw	%ax,%dx
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_read_multi_2; .type NEPC_RA_io_space_read_multi_2,@function; NEPC_RA_io_space_read_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	insw
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_write_multi_2; .type NEPC_RA_io_space_write_multi_2,@function; NEPC_RA_io_space_write_multi_2:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	outsw
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_read_region_2; .type NEPC_RA_io_space_read_region_2,@function; NEPC_RA_io_space_read_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_read_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_write_region_2; .type NEPC_RA_io_space_write_region_2,@function; NEPC_RA_io_space_write_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_write_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_set_multi_2; .type NEPC_RA_io_space_set_multi_2,@function; NEPC_RA_io_space_set_multi_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_set_multi_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret


.text; .align	4,0x90; .globl NEPC_RA_io_space_set_region_2; .type NEPC_RA_io_space_set_region_2,@function; NEPC_RA_io_space_set_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_set_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_copy_region_2; .type NEPC_RA_io_space_copy_region_2,@function; NEPC_RA_io_space_copy_region_2:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_copy_region_2
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_read_4; .type NEPC_RA_io_space_read_4,@function; NEPC_RA_io_space_read_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	inl	%dx,%eax
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_write_4; .type NEPC_RA_io_space_write_4,@function; NEPC_RA_io_space_write_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	outl	%eax,%dx
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_read_multi_4; .type NEPC_RA_io_space_read_multi_4,@function; NEPC_RA_io_space_read_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	insl
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_write_multi_4; .type NEPC_RA_io_space_write_multi_4,@function; NEPC_RA_io_space_write_multi_4:
	movl BUS_SPACE_HANDLE_IAT(%ebx, %edx, 4), %edx
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	cld
	rep
	outsl
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_read_region_4; .type NEPC_RA_io_space_read_region_4,@function; NEPC_RA_io_space_read_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_read_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_write_region_4; .type NEPC_RA_io_space_write_region_4,@function; NEPC_RA_io_space_write_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_write_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_set_multi_4; .type NEPC_RA_io_space_set_multi_4,@function; NEPC_RA_io_space_set_multi_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_set_multi_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret


.text; .align	4,0x90; .globl NEPC_RA_io_space_set_region_4; .type NEPC_RA_io_space_set_region_4,@function; NEPC_RA_io_space_set_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_set_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret

.text; .align	4,0x90; .globl NEPC_RA_io_space_copy_region_4; .type NEPC_RA_io_space_copy_region_4,@function; NEPC_RA_io_space_copy_region_4:
	pushl	%ebp		;	pushl	%eax		;	pushl	%edx		;	movl	$0x2a8e,%edx	;	inb	%dx,%al		;	movl	%eax,%ebp	;	andl	$~0x20,%eax	;	outb	%al,%dx		;	popl	%edx		;	popl	%eax
	call SBUS_RA_io_space_copy_region_4
	pushl	%eax		;	movl	%ebp,%eax	;	xchgl	%edx,%ebp	;	movl	$0x2a8e,%edx	;	outb	%al,%dx		;	xchgl	%ebp,%edx	;	popl	%eax		;	popl	%ebp
	ret
# 633 "../../../../arch/pc98/pc98/locore.S" 2


# 1 "../../../../arch/i386/i386/locore_subr.S" 1





















































































.text; .align	4,0x90; .globl proc_trampoline; .type proc_trampoline,@function; proc_trampoline:



	movl	$0x0,cpu_info_primary+272
	pushl	%ebx
	call	*%esi
	addl	$4,%esp
	movl	0(%esp),%gs	; movl	4(%esp),%fs	; movl	8(%esp),%es	; movl	12(%esp),%ds	; movl	16(%esp),%edi	; movl	20(%esp),%esi	; movl	24(%esp),%ebp	; movl	28(%esp),%ebx	; movl	32(%esp),%edx	; movl	36(%esp),%ecx	; movl	40(%esp),%eax	; addl	$(44+8),%esp	; iret
	







.text; .align	4,0x90; .globl sigcode; .type sigcode,@function; sigcode:
	



	leal	12(%esp),%eax		# get pointer to sigcontext
	movl	%eax,4(%esp)		# put it in the argument slot
					# fake return address already there
	movl	$295,%eax
	int	$0x80	 		# enter kernel with args on stack
	movl	$1,%eax
	int	$0x80			# exit if sigreturn fails
	.globl	esigcode
esigcode:


















.text; .align	4,0x90; .globl fillw; .type fillw,@function; fillw:; 
	pushl	%edi
	movl	8(%esp),%eax
	movl	12(%esp),%edi
	movw	%ax,%cx
	rorl	$16,%eax
	movw	%cx,%ax
	cld
	movl	16(%esp),%ecx
	shrl	%ecx			# do longwords
	rep
	stosl
	movl	16(%esp),%ecx
	andl	$1,%ecx			# do remainder
	rep
	stosw
	popl	%edi
	ret






.text; .align	4,0x90; .globl kcopy; .type kcopy,@function; kcopy:; 
	pushl	%esi
	pushl	%edi
	movl	cpu_info_primary+128,%eax		# load curpcb into eax and set on-fault
	pushl	644(%eax)
	movl	$copy_fault, 644(%eax)

	movl	16(%esp),%esi
	movl	20(%esp),%edi
	movl	24(%esp),%ecx
	movl	%edi,%eax
	subl	%esi,%eax
	cmpl	%ecx,%eax		# overlapping?
	jb	1f
	cld				# nope, copy forward
	shrl	$2,%ecx			# copy by 32-bit words
	rep
	movsl
	movl	24(%esp),%ecx
	andl	$3,%ecx			# any bytes left?
	rep
	movsb

	movl	cpu_info_primary+128,%edx		# XXX save curpcb?
	popl	644(%edx)
	popl	%edi
	popl	%esi
	xorl	%eax,%eax
	ret

	.align	4,0x90
1:	addl	%ecx,%edi		# copy backward
	addl	%ecx,%esi
	std
	andl	$3,%ecx			# any fractional bytes?
	decl	%edi
	decl	%esi
	rep
	movsb
	movl	24(%esp),%ecx		# copy remainder by 32-bit words
	shrl	$2,%ecx
	subl	$3,%esi
	subl	$3,%edi
	rep
	movsl
	cld

	movl	cpu_info_primary+128,%edx
	popl	644(%edx)
	popl	%edi
	popl	%esi
	xorl	%eax,%eax
	ret


























	.data

	.globl	copyout_func
copyout_func:
	.long	i486_copyout

	.globl	copyin_func
copyin_func:
	.long	i386_copyin

	.text







.text; .align	4,0x90; .globl copyout; .type copyout,@function; copyout:; 
	jmp	*copyout_func

# 347 "../../../../arch/i386/i386/locore_subr.S"




.text; .align	4,0x90; .globl i486_copyout; .type i486_copyout,@function; i486_copyout:; 
	pushl	%esi
	pushl	%edi
	pushl	$0
	
	movl	16(%esp),%esi
	movl	20(%esp),%edi
	movl	24(%esp),%eax

	



	movl	%edi,%edx
	addl	%eax,%edx
	jc	copy_efault
	cmpl	$-1077952512,%edx
	ja	copy_efault

	movl	cpu_info_primary+128,%edx
	movl	$copy_fault,644(%edx)

	
	cld
	movl	%eax,%ecx
	shrl	$2,%ecx
	rep
	movsl
	movl	%eax,%ecx
	andl	$3,%ecx
	rep
	movsb

	popl	644(%edx)
	popl	%edi
	popl	%esi
	xorl	%eax,%eax
	ret








.text; .align	4,0x90; .globl copyin; .type copyin,@function; copyin:; 
	jmp	*copyin_func




.text; .align	4,0x90; .globl i386_copyin; .type i386_copyin,@function; i386_copyin:; 
	pushl	%esi
	pushl	%edi
	movl	cpu_info_primary+128,%eax
	pushl	$0
	movl	$copy_fault,644(%eax)
	
	movl	16(%esp),%esi
	movl	20(%esp),%edi
	movl	24(%esp),%eax

	




	movl	%esi,%edx
	addl	%eax,%edx
	jc	copy_efault
	cmpl	$-1077952512,%edx
	ja	copy_efault

	
	cld
	movl	%eax,%ecx
	shrl	$2,%ecx
	rep
	movsl
	movl	%eax,%ecx
	andl	$3,%ecx
	rep
	movsb

	movl	cpu_info_primary+128,%edx
	popl	644(%edx)
	popl	%edi
	popl	%esi
	xorl	%eax,%eax
	ret



.text; .align	4,0x90; .globl copy_efault; .type copy_efault,@function; copy_efault:
	movl	$14,%eax


.text; .align	4,0x90; .globl copy_fault; .type copy_fault,@function; copy_fault:
	movl	cpu_info_primary+128,%edx
	popl	644(%edx)
	popl	%edi
	popl	%esi
	ret










.text; .align	4,0x90; .globl copyoutstr; .type copyoutstr,@function; copyoutstr:; 
	pushl	%esi
	pushl	%edi

	movl	12(%esp),%esi		# esi = from
	movl	16(%esp),%edi		# edi = to
	movl	20(%esp),%edx		# edx = maxlen

# 537 "../../../../arch/i386/i386/locore_subr.S"



5:	movl	cpu_info_primary+128,%eax
	movl	$copystr_fault,644(%eax)
	


	movl	$-1077952512,%eax
	subl	%edi,%eax
	cmpl	%edx,%eax
	jae	1f
	movl	%eax,%edx
	movl	%eax,20(%esp)

1:	incl	%edx
	cld

1:	decl	%edx
	jz	2f
	lodsb
	stosb
	testb	%al,%al
	jnz	1b

	
	decl	%edx
	xorl	%eax,%eax
	jmp	copystr_return

2:	
	cmpl	$-1077952512,%edi
	jae	copystr_efault
	movl	$63,%eax
	jmp	copystr_return











.text; .align	4,0x90; .globl copyinstr; .type copyinstr,@function; copyinstr:; 
	pushl	%esi
	pushl	%edi
	movl	cpu_info_primary+128,%ecx
	movl	$copystr_fault,644(%ecx)

	movl	12(%esp),%esi		# %esi = from
	movl	16(%esp),%edi		# %edi = to
	movl	20(%esp),%edx		# %edx = maxlen

	


	movl	$-1077952512,%eax
	subl	%esi,%eax
	cmpl	%edx,%eax
	jae	1f
	movl	%eax,%edx
	movl	%eax,20(%esp)

1:	incl	%edx
	cld

1:	decl	%edx
	jz	2f
	lodsb
	stosb
	testb	%al,%al
	jnz	1b

	
	decl	%edx
	xorl	%eax,%eax
	jmp	copystr_return

2:	
	cmpl	$-1077952512,%esi
	jae	copystr_efault
	movl	$63,%eax
	jmp	copystr_return


.text; .align	4,0x90; .globl copystr_efault; .type copystr_efault,@function; copystr_efault:
	movl	$14,%eax


.text; .align	4,0x90; .globl copystr_fault; .type copystr_fault,@function; copystr_fault:
copystr_return:
	
	movl	cpu_info_primary+128,%ecx
	movl	$0,644(%ecx)
	movl	20(%esp),%ecx
	subl	%edx,%ecx
	movl	24(%esp),%edx
	testl	%edx,%edx
	jz	8f
	movl	%ecx,(%edx)

8:	popl	%edi
	popl	%esi
	ret









.text; .align	4,0x90; .globl copystr; .type copystr,@function; copystr:; 
	pushl	%esi
	pushl	%edi

	movl	12(%esp),%esi		# esi = from
	movl	16(%esp),%edi		# edi = to
	movl	20(%esp),%edx		# edx = maxlen
	incl	%edx
	cld

1:	decl	%edx
	jz	4f
	lodsb
	stosb
	testb	%al,%al
	jnz	1b

	
	decl	%edx
	xorl	%eax,%eax
	jmp	6f

4:	
	movl	$63,%eax

6:	
	movl	20(%esp),%ecx
	subl	%edx,%ecx
	movl	24(%esp),%edx
	testl	%edx,%edx
	jz	7f
	movl	%ecx,(%edx)

7:	popl	%edi
	popl	%esi
	ret







.text; .align	4,0x90; .globl fuword; .type fuword,@function; fuword:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-4,%edx
	ja	fusuaddrfault
	movl	cpu_info_primary+128,%ecx
	movl	$fusufault,644(%ecx)
	movl	(%edx),%eax
	movl	$0,644(%ecx)
	ret
	






.text; .align	4,0x90; .globl fusword; .type fusword,@function; fusword:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-2,%edx
	ja	fusuaddrfault
	movl	cpu_info_primary+128,%ecx
	movl	$fusufault,644(%ecx)
	movzwl	(%edx),%eax
	movl	$0,644(%ecx)
	ret
	







.text; .align	4,0x90; .globl fuswintr; .type fuswintr,@function; fuswintr:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-2,%edx
	ja	fusuaddrfault
	movl	cpu_info_primary+92,%ecx
	movl	452(%ecx),%ecx
	movl	$fusubail,644(%ecx)
	movzwl	(%edx),%eax
	movl	$0,644(%ecx)
	ret
	






.text; .align	4,0x90; .globl fubyte; .type fubyte,@function; fubyte:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-1,%edx
	ja	fusuaddrfault
	movl	cpu_info_primary+128,%ecx
	movl	$fusufault,644(%ecx)
	movzbl	(%edx),%eax
	movl	$0,644(%ecx)
	ret





.text; .align	4,0x90; .globl fusufault; .type fusufault,@function; fusufault:
	movl	$0,644(%ecx)
	movl	$-1,%eax
	ret







.text; .align	4,0x90; .globl fusubail; .type fusubail,@function; fusubail:
	movl	$0,644(%ecx)
	movl	$-1,%eax
	ret





.text; .align	4,0x90; .globl fusuaddrfault; .type fusuaddrfault,@function; fusuaddrfault:
	movl	$-1,%eax
	ret







.text; .align	4,0x90; .globl suword; .type suword,@function; suword:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-4,%edx
	ja	fusuaddrfault

# 820 "../../../../arch/i386/i386/locore_subr.S"


2:	movl	cpu_info_primary+128,%ecx
	movl	$fusufault,644(%ecx)

	movl	8(%esp),%eax
	movl	%eax,(%edx)
	xorl	%eax,%eax
	movl	%eax,644(%ecx)
	ret
	






.text; .align	4,0x90; .globl susword; .type susword,@function; susword:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-2,%edx
	ja	fusuaddrfault

# 867 "../../../../arch/i386/i386/locore_subr.S"


2:	movl	cpu_info_primary+128,%ecx
	movl	$fusufault,644(%ecx)

	movl	8(%esp),%eax
	movw	%ax,(%edx)
	xorl	%eax,%eax
	movl	%eax,644(%ecx)
	ret








.text; .align	4,0x90; .globl suswintr; .type suswintr,@function; suswintr:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-2,%edx
	ja	fusuaddrfault
	movl	cpu_info_primary+92,%ecx
	movl	452(%ecx),%ecx
	movl	$fusubail,644(%ecx)

# 908 "../../../../arch/i386/i386/locore_subr.S"


2:	movl	8(%esp),%eax
	movw	%ax,(%edx)
	xorl	%eax,%eax
	movl	%eax,644(%ecx)
	ret







.text; .align	4,0x90; .globl subyte; .type subyte,@function; subyte:; 
	movl	4(%esp),%edx
	cmpl	$-1077952512-1,%edx
	ja	fusuaddrfault

# 952 "../../../../arch/i386/i386/locore_subr.S"


2:	movl	cpu_info_primary+128,%ecx
	movl	$fusufault,644(%ecx)

	movb	8(%esp),%al
	movb	%al,(%edx)
	xorl	%eax,%eax
	movl	%eax,644(%ecx)
	ret
















.text; .align	4,0x90; .globl lgdt; .type lgdt,@function; lgdt:
	
	movl	4(%esp),%eax
	lgdt	(%eax)
	
	jmp	1f
	nop
1:	
	movl	$(((2) << 3) |  0),%eax
	movw	%ax,%ds
	movw	%ax,%es
	movw	%ax,%gs
	movw	%ax,%ss
	movl	$(((6) << 3) |  0),%eax
	movw	%ax,%fs
	
	popl	%eax
	pushl	$(((1) << 3) |  0)
	pushl	%eax
	lret








.text; .align	4,0x90; .globl setjmp; .type setjmp,@function; setjmp:; 
	movl	4(%esp),%eax
	movl	%ebx,(%eax)		# save ebx
	movl	%esp,4(%eax)		# save esp
	movl	%ebp,8(%eax)		# save ebp
	movl	%esi,12(%eax)		# save esi
	movl	%edi,16(%eax)		# save edi
	movl	(%esp),%edx		# get rta
	movl	%edx,20(%eax)		# save eip
	xorl	%eax,%eax		# return (0);
	ret


.text; .align	4,0x90; .globl longjmp; .type longjmp,@function; longjmp:; 
	movl	4(%esp),%eax
	movl	(%eax),%ebx		# restore ebx
	movl	4(%eax),%esp		# restore esp
	movl	8(%eax),%ebp		# restore ebp
	movl	12(%eax),%esi		# restore esi
	movl	16(%eax),%edi		# restore edi
	movl	20(%eax),%edx		# get rta
	movl	%edx,(%esp)		# put in return frame
	xorl	%eax,%eax		# return (1);
	incl	%eax
	ret



	.globl	sched_whichqs,sched_qs
	.globl	uvmexp,panic


.text; .align	4,0x90; .globl switch_error; .type switch_error,@function; switch_error:
	pushl	$1f
	call	panic
	
1:	.asciz	"cpu_switch"












.text; .align	4,0x90; .globl cpu_switch; .type cpu_switch,@function; cpu_switch:; 
	pushl	%ebx
	pushl	%esi
	pushl	%edi


	cmpl	$0xc,cpu_info_primary+272
	jae	1f
	pushl	2f
	call	panic
	
2:	.asciz	"not splhigh() in cpu_switch!"

1:	

	
	movl	cpu_info_primary+92,%esi

	






	movl	$0,cpu_info_primary+92
	











	
	cli				# splhigh doesn't do a cli
	movl	sched_whichqs,%ecx
	bsfl	%ecx,%ebx		# find a full q
	jnz	switch_dequeue

	








	pushl	%esi
	call	pmap_deactivate	# pmap_deactivate(oldproc)
	addl	$4,%esp

	movl	452(%esi),%esi

	
	movl	%esp,56(%esi)
	movl	%ebp,60(%esi)

	

	movl	$proc0,%ebx
	movl	452(%ebx),%edi
	movl	464(%ebx),%edx




	movl	$0,cpu_info_primary+92		

	
	cli

	
	movl	56(%edi),%esp
	movl	60(%edi),%ebp


	
	movl	28(%edi),%ecx
	movl	%ecx,%cr3

	



	movl	gdt,%eax

	andl	$~0x0200,4-0(%eax,%edx,1)
	ltr	%dx

	

	
	movl	104(%edi),%ecx
	movl	%ecx,%cr0

	
	movl	%edi,cpu_info_primary+CPU_INFO_CURPC

	xorl	%esi,%esi
	sti
idle_unlock:	



	
	pushl	$0x0		# spl0()
	call	Xspllower	# process pending interrupts
	addl	$4,%esp
	jmp	idle_start
idle_zero:		
	sti
	call	uvm_pageidlezero
	cli
	cmpl	$0,sched_whichqs
	jnz	idle_exit
idle_loop:
	
	movl	uvm+40,%ecx
	testl	%ecx,%ecx
	jnz	idle_zero
	sti
	hlt
.text; .align	4,0x90; .globl mpidle; .type mpidle,@function; mpidle:
idle_start:	
	cli
	cmpl	$0,sched_whichqs
	jz	idle_loop
idle_exit:	
	movl	$0xd,cpu_info_primary+272		# splhigh



	movl	sched_whichqs,%ecx
	bsfl	%ecx,%ebx
	jz	idle_unlock

switch_dequeue:		
	



	sti
	leal	sched_qs(,%ebx,8),%eax # select q

	movl	0(%eax),%edi	# unlink from front of process q

	cmpl	%edi,%eax		# linked to self (i.e. nothing queued)?
	je	switch_error	# not possible

	movl	0(%edi),%edx
	movl	%edx,0(%eax)
	movl	%eax,4(%edx)

	cmpl	%edx,%eax		# q empty?
	jne	3f

	btrl	%ebx,%ecx		# yes, clear to indicate empty
	movl	%ecx,sched_whichqs # update q status

3:	
	xorl	%eax,%eax
	movl	%eax,cpu_info_primary+492


	cmpl	%eax,128(%edi)	# Waiting for something?
	jne	switch_error	# Yes; shouldn't be queued.
	cmpb	$2,56(%edi)	# In run state?
	jne	switch_error	# No; shouldn't be queued.


	
	movl	%eax,4(%edi)

	
	movb	$7,56(%edi)	# p->p_stat = 7
	movl	%edi,cpu_info_primary+92

	
	cmpl	%edi,%esi
	je	switch_return

	
	testl	%esi,%esi
	jz	switch_exited

	








	pushl	%esi
	call	pmap_deactivate	# pmap_deactivate(oldproc)
	addl	$4,%esp

	movl	452(%esi),%esi

	
	movl	%esp,56(%esi)
	movl	%ebp,60(%esi)

switch_exited:
	








	
	cli
	movl	452(%edi),%esi

	
	movl	56(%esi),%esp
	movl	60(%esi),%ebp










	
	movl	gdt,%eax

	movl	464(%edi),%edx

	
	andl	$~0x0200,4(%eax,%edx, 1)
	ltr	%dx

	pushl	%edi
	call	pmap_activate		# pmap_activate(p)
	addl	$4,%esp




	
	movl	104(%esi),%ecx
# 1320 "../../../../arch/i386/i386/locore_subr.S"

	movl	%ecx,%cr0

	
	movl	%esi,cpu_info_primary+CPU_INFO_CURPC

	
	sti




	movl	cpu_info_primary+92,%edi
	cmpl	$0,100(%edi)
	je	1f
	movl	456(%edi),%ebx
	movl	52(%ebx),%eax
	pushl	%eax
	pushl	%edi
	call	ras_lookup
	addl	$8,%esp
	cmpl	$-1,%eax
	je	1f
	movl	%eax,52(%ebx)
1:

switch_return:



	pushl	$0x0		# spl0()
	call	Xspllower	# process pending interrupts
	addl	$4,%esp
	movl	$0xd,cpu_info_primary+272	# splhigh()
	
	movl	%edi,%eax		# return (p);
	popl	%edi
	popl	%esi
	popl	%ebx
	ret









	.globl	proc0

	.globl  uvmspace_free,kernel_map
	.globl	uvm_km_free,tss_free

.text; .align	4,0x90; .globl switch_exit; .type switch_exit,@function; switch_exit:; 
	movl	4(%esp),%edi		# old process

	movl	$proc0,%ebx
	movl	452(%ebx),%esi
	movl	464(%ebx),%edx




	
	movl	$0,cpu_info_primary+92

	
	cli

	
	movl	56(%esi),%esp
	movl	60(%esi),%ebp

	



	
	movl	gdt,%eax


	
	movl	28(%esi),%ecx
	movl	%ecx,%cr3

	
	andl	$~0x0200,4-0(%eax,%edx,1)
	ltr	%dx

	

	
	movl	104(%esi),%ecx
	movl	%ecx,%cr0

	
	movl	%esi,cpu_info_primary+CPU_INFO_CURPC

	
	sti

	


	pushl	%edi			
	call	exit2
	addl	$4,%esp

	
	xorl	%esi,%esi
	movl	%esi,cpu_info_primary+92
	jmp	idle_start






.text; .align	4,0x90; .globl savectx; .type savectx,@function; savectx:; 
	movl	4(%esp),%edx		# edx = p->p_addr
  
	
	movl	%esp,56(%edx)
	movl	%ebp,60(%edx)

	ret





.align	4,0x90; .globl Xosyscall; Xosyscall:
	
	pushfl
	popl	8(%esp)
	pushl	$7		# size of instruction for restart
	jmp	syscall1





.align	4,0x90; .globl Xsyscall; Xsyscall:
	pushl	$2		# size of instruction for restart
syscall1:
	pushl	$3	# trap # for doing ASTs
	subl	$44,%esp	; movl	%gs,0(%esp)	; movl	%fs,4(%esp) ; movl	%es,8(%esp) ; movl	%ds,12(%esp) ; movl	%edi,16(%esp)	; movl	%esi,20(%esp)	; movl	%eax,40(%esp)	; movl	$(((2) << 3) |  0),%eax	; movl	%eax,%ds	; movl	%ebp,24(%esp)	; movl	%eax,%es	; movl	%ebx,28(%esp)	; movl	%eax,%gs	; movl	$(((6) << 3) |  0),%eax	; movl	%edx,32(%esp)	; movl	%eax,%fs	; movl	%ecx,36(%esp)	; 


	movl	cpu_info_primary+272,%ebx
	testl	%ebx,%ebx
	jz	1f
	pushl	$5f
	call	printf
	addl	$4,%esp

	int	$3

1:	

	movl	cpu_info_primary+92,%edx
	movl	%esp,456(%edx)	# save pointer to frame
	call	*468(%edx)	# get pointer to syscall() function
2:	
	cli
	cmpl $0,cpu_info_primary+496
	je	1f
	
	movl $0,cpu_info_primary+496
	sti
	
	call	trap
	jmp	2b



1:	cmpl	$0x0,cpu_info_primary+272
	jne	3f
	movl	0(%esp),%gs	; movl	4(%esp),%fs	; movl	8(%esp),%es	; movl	12(%esp),%ds	; movl	16(%esp),%edi	; movl	20(%esp),%esi	; movl	24(%esp),%ebp	; movl	28(%esp),%ebx	; movl	32(%esp),%edx	; movl	36(%esp),%ecx	; movl	40(%esp),%eax	; addl	$(44+8),%esp	; iret
3:	sti
	pushl	$4f
	call	printf
	addl	$4,%esp

	int	$3

	movl	$0x0,cpu_info_primary+272
	jmp	2b
4:	.asciz	"WARNING: SPL NOT LOWERED ON SYSCALL EXIT\n"
5:	.asciz	"WARNING: SPL NOT ZERO ON SYSCALL ENTRY\n"	










.text; .align	4,0x90; .globl probetrap; .type probetrap,@function; probetrap:
	ss
	incl	npx_traps_while_probing
	fnclex
	iret


.text; .align	4,0x90; .globl npx586bug1; .type npx586bug1,@function; npx586bug1:
	fildl	4(%esp)		# x
	fildl	8(%esp)		# y
	fld	%st(1)
	fdiv	%st(1),%st	# x/y
	fmulp	%st,%st(1)	# (x/y)*y
	fsubrp	%st,%st(1)	# x-(x/y)*y
	pushl	$0
	fistpl	(%esp)
	popl	%eax
	ret

# 635 "../../../../arch/pc98/pc98/locore.S" 2


