Commit 29ace1f8 authored by Linus Torvalds's avatar Linus Torvalds

Remove all of arch/s390x and include/asm-s390x, since the 390x

architecture is now just a 64-bit configuration option of the
basic s390 architecture.
parent 06da5d99
This diff is collapsed.
# s390x/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#
LDFLAGS := -m elf64_s390
OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux := -e start
MODFLAGS += -fpic -D__PIC__
LDFLAGS_BLOB := --format binary --oformat elf64-s390
CFLAGS += -pipe -fno-strength-reduce -finline-limit=10000 -Wno-sign-compare
head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
core-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/
libs-y += arch/$(ARCH)/lib/
drivers-y += drivers/s390/
makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1)
all: image listing
listing image: vmlinux
$(call makeboot,arch/$(ARCH)/boot/$@)
install: vmlinux
$(call makeboot, $@)
archclean:
$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot
prepare: include/asm-$(ARCH)/offsets.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/offsets.h
#
# Makefile for the linux s390-specific parts of the memory manager.
#
targets := image listing
EXTRA_AFLAGS := -traditional
quiet_cmd_listing = OBJDUMP $@
cmd_listing = $(OBJDUMP) --disassemble --disassemble-all \
--disassemble-zeroes --reloc vmlinux > $@
$(obj)/image: vmlinux FORCE
$(call if_changed,objcopy)
$(obj)/listing: vmlinux FORCE
$(call if_changed,listing)
install: $(CONFIGURE) $(obj)/image
sh -x $(obj)/install.sh $(KERNELRELEASE) $(obj)/image \
System.map Kerntypes "$(INSTALL_PATH)"
#!/bin/sh
#
# arch/s390x/boot/install.sh
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995 by Linus Torvalds
#
# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
#
# "make install" script for s390 architecture
#
# Arguments:
# $1 - kernel version
# $2 - kernel image file
# $3 - kernel map file
# $4 - default install path (blank if root directory)
#
# User may have a custom install script
if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi
if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
# Default install - same as make zlilo
if [ -f $4/vmlinuz ]; then
mv $4/vmlinuz $4/vmlinuz.old
fi
if [ -f $4/System.map ]; then
mv $4/System.map $4/System.old
fi
cat $2 > $4/vmlinuz
cp $3 $4/System.map
/*
* arch/s390/boot/ipldump.S
*
* S390 version
* Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*
* Tape dump ipl record. Put it on a tape and ipl from it and it will
* write a dump of the real storage after the ipl record on that tape.
*/
#include <asm/setup.h>
#include <asm/lowcore.h>
#define IPL_BS 1024
.org 0
.long 0x00080000,0x80000000+_start # The first 24 bytes are loaded
.long 0x07000000,0x60000001 # by ipl to addresses 0-23.
.long 0x02000000,0x20000000+IPL_BS # (a PSW and two CCWs).
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000 # svc old psw
.long 0x00000000,0x00000000 # program check old psw
.long 0x00000000,0x00000000 # machine check old psw
.long 0x00000000,0x00000000 # io old psw
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x000a0000,0x00000058 # external new psw
.long 0x000a0000,0x00000060 # svc new psw
.long 0x000a0000,0x00000068 # program check new psw
.long 0x000a0000,0x00000070 # machine check new psw
.long 0x00080000,0x80000000+.Lioint # io new psw
.org 0x100
.globl _start
_start:
l %r1,0xb8 # load ipl subchannel number
#
# find out memory size
#
mvc 104(8),.Lpcmem0 # setup program check handler
slr %r3,%r3
lhi %r2,1
sll %r2,20
.Lloop0:
l %r0,0(%r3) # test page
ar %r3,%r2 # add 1M
jnm .Lloop0 # r1 < 0x80000000 -> loop
.Lchkmem0:
n %r3,.L4malign0 # align to multiples of 4M
st %r3,.Lmemsize # store memory size
.Lmemok:
#
# first write a tape mark
#
bras %r14,.Ltapemark
#
# write real storage to tape
#
slr %r2,%r2 # start at address 0
bras %r14,.Lwriter # load ramdisk
#
# write another tape mark
#
bras %r14,.Ltapemark
#
# everything written, stop processor
#
lpsw .Lstopped
#
# subroutine for writing to tape
# Paramters:
# R1 = device number
# R2 = start address
# R3 = length
.Lwriter:
st %r14,.Lldret
la %r12,.Lorbread # r12 = address of orb
la %r5,.Lirb # r5 = address of irb
st %r2,.Lccwwrite+4 # initialize CCW data addresses
lctl %c6,%c6,.Lcr6
slr %r2,%r2
.Lldlp:
lhi %r6,3 # 3 retries
.Lssch:
ssch 0(%r12) # write chunk of IPL_BS bytes
jnz .Llderr
.Lw4end:
bras %r14,.Lwait4io
tm 8(%r5),0x82 # do we have a problem ?
jnz .Lrecov
l %r0,.Lccwwrite+4 # update CCW data addresses
ahi %r0,IPL_BS
st %r0,.Lccwwrite+4
clr %r0,%r3 # enough ?
jl .Lldlp
.Ldone:
l %r14,.Lldret
br %r14 # r2 contains the total size
.Lrecov:
bras %r14,.Lsense # do the sensing
brct %r6,.Lssch # dec. retry count & branch
j .Llderr
.Ltapemark:
st %r14,.Lldret
la %r12,.Lorbmark # r12 = address of orb
la %r5,.Lirb # r5 = address of irb
lctl %c6,%c6,.Lcr6
ssch 0(%r12) # write a tape mark
jnz .Llderr
bras %r14,.Lwait4io
l %r14,.Lldret
br %r14
#
# Sense subroutine
#
.Lsense:
st %r14,.Lsnsret
la %r7,.Lorbsense
ssch 0(%r7) # start sense command
jnz .Llderr
bras %r14,.Lwait4io
l %r14,.Lsnsret
tm 8(%r5),0x82 # do we have a problem ?
jnz .Llderr
br %r14
#
# Wait for interrupt subroutine
#
.Lwait4io:
lpsw .Lwaitpsw
.Lioint:
c %r1,0xb8 # compare subchannel number
jne .Lwait4io
tsch 0(%r5)
slr %r0,%r0
tm 8(%r5),0x82 # do we have a problem ?
jnz .Lwtexit
tm 8(%r5),0x04 # got device end ?
jz .Lwait4io
.Lwtexit:
br %r14
.Llderr:
lpsw .Lcrash
.align 8
.Lorbread:
.long 0x00000000,0x0080ff00,.Lccwwrite
.align 8
.Lorbsense:
.long 0x00000000,0x0080ff00,.Lccwsense
.align 8
.Lorbmark:
.long 0x00000000,0x0080ff00,.Lccwmark
.align 8
.Lccwwrite:
.long 0x01200000+IPL_BS,0x00000000
.Lccwsense:
.long 0x04200001,0x00000000
.Lccwmark:
.long 0x1f200001,0x00000000
.Lwaitpsw:
.long 0x020a0000,0x80000000+.Lioint
.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.Lcr6: .long 0xff000000
.align 8
.Lcrash:.long 0x000a0000,0x00000000
.Lstopped: .long 0x000a0000,0x00001234
.Lpcmem0:.long 0x00080000,0x80000000 + .Lchkmem0
.L4malign0:.long 0xffc00000
.Lmemsize:.long 0
.Lldret:.long 0
.Lsnsret: .long 0
.org IPL_BS
#
# arch/s390/boot/ipleckd.S
# IPL record for 3380/3390 DASD
#
# S390 version
# Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
# Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>
#
#
# FIXME: should use the countarea to determine the blocksize
# FIXME: should insert zeroes into memory when filling holes
# FIXME: calculate blkpertrack from rdc data and blksize
# change 09/20/00 removed obsolete store of ipldevice to textesegment
# Usage of registers
# r1: ipl subchannel ( general use, dont overload without save/restore !)
# r10:
# r13: base register index to 0x0000
# r14: callers address
# r15: temporary save register (we have no stack!)
# storage layout:
#include <asm/lowcore.h>
.org 0
.psw: .long 0x00080000,0x80000000+_start
.ccw1: .long 0x06000000,0x00001000 # Re-Read enough of bootsector to start
.ccw2: .long 0x00000000,0x00000000 # read countarea of record 1 to s/w.
.org 0x58
.Lextn: .long 0x000a0000,0x00000000+.Lextn
.Lsvcn: .long 0x000a0000,0x00000000+.Lsvcn
.Lprgn: .long 0x00080000,0x00000000+.Lecs
.Lmcn: .long 0x000a0000,0x00000000+.Lmcn
.Lion: .long 0x00080000,0x80000000+.Lionewaddr
.org 0xe0
.Llstad:.long 0x00000000,0x00000000 # sectorno + ct of bootlist
.org 0xf0 # Lets start now...
_start: .globl _start
l %r1,__LC_SUBCHANNEL_ID # get IPL-subchannel from lowcore
st %r1,__LC_IPLDEV # keep it for reipl
stsch .Lrdcdata
oi .Lrdcdata+5,0x84 # enable ssch and multipath mode
.Lecs: xi .Lrdcdata+27,0x01 # enable concurrent sense
msch .Lrdcdata
xi .Lprgn,6 # restore Wait and d/a bit in PCnew PSW
l %r2,.Lparm
mvc 0x0(8,%r2),.Lnull # set parmarea to null
lctl %c6,%c6,.Lc6 # enable all interrupts
.Lrdc: # read device characteristics
la %r6,.Lrdcccw
st %r6,.Lorb+8 # store cp-address to orb
bras %r15,.Lssch # start I/O
oi .Llodata+1,0x80
lh %r5,.Lcountarea+6 # init r5 from countarea
stcm %r5,3,.Lrdccw+2 # and store into rd template *FIXME*
stcm %r5,3,.Llodata+14 # and store into lodata *FIXME*
.Lbootlist:
l %r2,.Llstad
l %r3,.Lblklst
lhi %r4,1
bras %r14,.Lreadblks
.Lloader:
l %r10,.Lblklst # r10 is index to bootlist
lhi %r5,4 # r5: skip 4 blocks = firstpage....
.Lkloop:
clc .Lnull(8),0(%r10) # test blocklist
jz .Lchkparm # end of list?
l %r2,0(%r10) # get startblock to r2
slr %r4,%r4 # erase r4
icm %r4,1,7(%r10) # get blockcount
slr %r3,%r3 # get address to r3
icm %r3,0xe,4(%r10)
chi %r5,0 # still blocks to skip?
jz .Ldoread # no: start reading
cr %r5,%r4 # #skipblocks >= blockct?
jm .L007 # no: skip the blocks one by one
.L006:
sr %r5,%r4 # decrease number of blocks to skip
j .Lkcont # advance to next entry
.L007:
ahi %r2,1 # skip 1 block...
bctr %r4,0 # update blockct
ah %r3,.Lcountarea+6 # increment address
bct %r5,.L007 # 4 blocks skipped?
.Ldoread:
ltr %r2,%r2 # test startblock
jz .Lzeroes # startblocks is zero (hole)
.Ldiskread:
bras %r14,.Lreadblks
j .Lkcont
.Lzeroes:
lr %r2,%r3
.L001: slr %r3,%r3
icm %r3,3,.Lcountarea+6 # get blocksize
slr %r5,%r5 # no bytes to move
.L008: mvcle %r2,%r4,0 # fill zeroes to storage
jo .L008 # until block is filled
brct %r4,.L001 # skip to next block
.Lkcont:
ahi %r10,8
j .Lkloop
.Lchkparm:
lm %r3,%r4,.Lstart # load .Lstart and .Lparm
clc 0x0(4,%r4),.Lnull
je .Lrunkern
mvc 0x480(128,%r3),0(%r4) # move 1k-0x80 to parmarea
mvc 0x500(256,%r3),0x80(%r4)
mvc 0x600(256,%r3),0x180(%r4)
mvc 0x700(256,%r3),0x280(%r4)
.Lrunkern:
# lhi %r2,17
# sll %r2,12
# st %r1,0xc6c(%r2) # store iplsubchannel to lowcore
# st %r1,0xc6c # store iplsubchannel to lowcore
br %r3
# This function does the start IO
# r2: number of first block to read ( input by caller )
# r3: address to read data to ( input by caller )
# r4: number of blocks to read ( input by caller )
# r5: destroyed
# r6: blocks per track ( input by caller )
# r7: number of heads
# r8:
# r9:
# r10:
# r11: temporary register
# r12: local use for base address
# r13: base address for module
# r14: address of caller for subroutine
# r15: temporary save register (since we have no stack)
.Lreadblks:
la %r12,.Ldeccw
st %r12,8+.Lorb # store cpaddr to orb
ahi %r12,0x10 # increment r12 to point to rdccw
oi 1(%r12),0x40 # set CC in rd template
# first setup the read CCWs
lr %r15,%r4 # save number or blocks
slr %r7,%r7
icm %r7,3,.Lrdcdata+14 # load heads to r7
lhi %r6,9
clc .Lrdcdata+3(2),.L9345
je .L011
lhi %r6,10
clc .Lrdcdata+3(2),.L3380
je .L011
lhi %r6,12
clc .Lrdcdata+3(2),.L3390
je .L011
bras %r14,.Ldisab
.L011:
# loop for nbl times
.Lrdloop:
mvc 0(8,%r12),.Lrdccw # copy template to this ccw
st %r3,4(%r12) # store target address to this ccw
bct %r4,.L005 # decrement no of blks still to do
ni 1(%r12),0x3f # delete CC from last ccw
lr %r4,%r15 # restore number of blocks
# read CCWs are setup now
stcm %r4,3,.Llodata+2 # store blockno to lodata clears r4
ar %r4,%r2 # r4 (clear): ebl = blk + nbl
bctr %r4,0 # decrement r4 ( last blk touched
srda %r2,32 # trk = blk / bpt, bot = blk % bpt
dr %r2,%r6 # r3: trk, r2: bot
ahi %r2,1 # bot++ ( we start counting at 1 )
stcm %r2,1,.Llodata+12 # store bot to lodata
xr %r2,%r2 # cy = trk / heads, hd = trk % heads
dr %r2,%r7 # r3: cy, r2: hd
sll %r3,16 # combine to CCHH in r3
or %r3,%r2
st %r3,.Ldedata+8 # store cchh to dedata
st %r3,.Llodata+4 # store cchh to lodata
st %r3,.Llodata+8 # store cchh to lodata
lr %r15,%r5 # save r5
srda %r4,32 # tr2 = ebl / bpt
dr %r4,%r6 # r5: tr2, r4: bot2
xr %r4,%r4 # cy2 = tr2 / heads, hd2 = hd2 % heads
dr %r4,%r7 # r5: cy2, r4: hd2
stcm %r5,3,.Ldedata+12 # store cy2,hd2 to dedata
stcm %r4,3,.Ldedata+14 # store cy2,hd2 to dedata
lr %r5,%r15 # restore r5
# CCWs are setup now, arent they?
bras %r15,.Lssch # start I/O
br %r14 # return to caller
.L005:
ah %r3,.Lcountarea+6 # add blocksize to target address
ahi %r12,8 # add sizeof(ccw) to base address
j .Lrdloop
# end of function
# This function does the start IO
# r1: Subchannel number
# r8: ORB address
# r9: IRB address
.Lssch:
lhi %r13,10 # initialize retries
.L012:
ssch .Lorb # start I/O
jz .Ltpi # ok?
bras %r14,.Ldisab # error
.Ltpi:
lpsw .Lwaitpsw # load wait-PSW
.Lionewaddr:
c %r1,0xb8 # compare to ipl subhchannel
jnz .Ltpi # not equal: loop
clc 0xbc(4),.Lorb # cross check the intparm
jnz .Ltpi # not equal: loop
tsch .Lirb # get status
tm .Lirb+9,0xff # channel status ?
jz .L003 # CS == 0x00
bras %r14,.Ldisab # error
.L003:
tm .Lirb+8,0xf3 # DS different from CE/DE
jz .L004 # ok ?
bct %r13,.L012 # retries <= 5 ?
bras %r14,.Ldisab # error
.L004:
tm .Lirb+8,0x04 # DE set?
jz .Ltpi # DE not set, loop
.Lsschend:
br %r15 # return to caller
# end of function
# In case of error goto disabled wait with %r14 containing the caller
.Ldisab:
st %r14,.Ldisabpsw+4
lpsw .Ldisabpsw
# FIXME pre-initialized data should be listed first
# NULLed storage can be taken from anywhere ;)
.Lblklst:
.long 0x00002000
.align 8
.Ldisabpsw:
.long 0x000a0000,0x00000000
.Lwaitpsw:
.long 0x020a0000,0x00000000+.Ltpi
.Lorb:
.long 0x0049504c,0x0080ff00 # intparm is " IPL"
.Lc6: .long 0xff000000
.Lstart:
.long 0x00010000 # do not separate .Lstart and .Lparm
.Lparm:
.long 0x00008000 # they are loaded with a LM
.L3390:
.word 0x3390
.L9345:
.word 0x9345
.L3380:
.word 0x3380
.Lnull:
.long 0x00000000,0x00000000
.align 4
.Lrdcdata:
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.Lirb:
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.long 0x00000000,0x00000000
.Lcountarea:
.word 0x0000 # cyl;
.word 0x0000 # head;
.byte 0x00 # record;
.byte 0x00 # key length;
.word 0x0000 # data length == blocksize;
.Ldedata:
.long 0x40c00000,0x00000000
.long 0x00000000,0x00000000
.Llodata:
.long 0x06000001,0x00000000
.long 0x00000000,0x01000000
.long 0x12345678
.org 0x7c8
.Lrdcccw: # CCW read device characteristics
.long 0x64400040,0x00000000+.Lrdcdata
.long 0x63400010,0x00000000+.Ldedata
.long 0x47400010,0x00000000+.Llodata
.long 0x12000008,0x00000000+.Lcountarea
.Ldeccw:
.long 0x63400010,0x00000000+.Ldedata
.Lloccw:
.long 0x47400010,0x00000000+.Llodata
.Lrdccw:
.long 0x86400000,0x00000000
.org 0x800
# end of pre initialized data is here CCWarea follows
# from here we load 1k blocklist
# end of function
#
# Ipl block for fba devices
# Copyright (C) 1998 IBM Corporation
# Author(s): Martin Schwidefsky
#
# startup for ipl at address 0
# start with restart
# The first 24 byes are loaded by ipl to addresses 0-23 (a PSW and two CCWs).
# The CCWs on 8-23 are used as a continuation of the implicit ipl channel
# program. The fba ipl loader only uses the CCW on 8-15 to load the first 512
# byte block to location 0-511 (the reading starts again at block 0, byte 0).
# The second CCW is used to store the location of the load list.
.org 0
.long 0x00080000,0x80000000+_start # The first 24 byte are loaded
.long 0x02000000,0x20000200 # by ipl to addresses 0-23.
.long 0x00000001,0x00000001 # (PSW, one CCW & loadlist info).
.globl _start
_start:
basr %r13,0
.LPG0:
l %r1,0xb8 # load ipl subchannel number
lhi %r2,0x200 # location for the loadlist
lm %r3,%r4,0x10 # blocknr and length of loadlist
bras %r14,.Lloader # load loadlist
lhi %r11,0x400
lhi %r12,0x200 # load address of loadlist
l %r3,0(%r12) # get first block number
l %r4,4(%r12) # get first block count
la %r12,8(%r12)
j .Llistloop
.org 0x50
.Llistloop:
lr %r2,%r11 # load address
lr %r5,%r4 # block count
mhi %r5,512
la %r11,0(%r5,%r11) # update load address
bras %r14,.Lloader # load chunk of the image
l %r3,0(%r12) # get next block number
icm %r4,15,4(%r12) # get next block count
la %r12,8(%r12)
jnz .Llistloop
#
# everything loaded, go for it
#
l %r1,.Lstart-.LPG0(%r13)
br %r1
#
# subroutine for loading a sequence of block from fba
# %r2: load address (24 bit address)
# %r3: number of first block (unsigned long)
# %r4: number of blocks to load (unsigned short)
#
.org 0xC0
.Lloader:
la %r5,.Llo-.LPG0(%r13)
sth %r4,2(%r5) # initialize block count
st %r3,4(%r5) # initialize block number
la %r5,.Lccws-.LPG0(%r13)
mhi %r4,512
sth %r4,22(%r5) # initialize byte count
icm %r2,8,16(%r5)
st %r2,16(%r5) # initialize CCW data address
slr %r2,%r2
la %r3,.Lorb-.LPG0(%r13) # r2 = address of orb into r2
la %r4,.Ltinfo-.LPG0(%r13) # r3 = address of tpi info block
la %r5,.Lirb-.LPG0(%r13) # r4 = address of irb
lctl %c6,%c6,.Lc6-.LPG0(%r13)
.Lldlp:
ssch 0(%r3) # read blocks
.Ltpi:
tpi 0(%r4) # test pending interrupt
jz .Ltpi
c %r1,0(%r4) # compare subchannel number
jne .Ltpi
tsch 0(%r5)
slr %r0,%r0
tm 8(%r5),0x82 # do we have a problem ?
jnz .Ldwpsw
tm 8(%r5),0x04 # got device end ?
jz .Ltpi
.Lexit:
br %r14
.align 8
.Ldwpsw:.long 0x000a0000,0x00000000
.Lorb: .long 0x00000000,0x0000ff00,.Lccws
.Ltinfo:.long 0
.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.Lc6: .long 0xff000000
.Lloadp:.long 0,0
.Lparm: .long 0x10400
.Lstart:.long 0x10000
.align 8
.Lccws: .long 0x63000000+.Lde,0x60000010 # define extent
.long 0x43000000+.Llo,0x60000008 # locate
# offset 1 in read CCW: data address (24 bit)
# offset 6 in read CCW: number of bytes (16 bit)
.long 0x42000000,0x20000000 # read
.Lde: .long 0x40000200,0x00000000
.long 0x00000000,0x00001000
# offset 2 in .Llo: block count (unsigned short)
# offset 4 in .Llo: block number (unsigned long)
.Llo: .long 0x06000000,0x00000000
.org 0x200
.long 0x00000002,0x0000007f
.long 0x00000081,0x0000007f
.long 0x00000100,0x0000007f
.long 0x0000017f,0x0000007f
.long 0x000001fe,0x0000007f
.long 0x0000027d,0x0000007f
.long 0x000002fc,0x0000007f
.long 0x0000037b,0x0000007f
.long 0x000003fa,0x0000007f
.long 0x00000479,0x0000007f
.long 0x000004f8,0x0000007f
.long 0x00000577,0x0000007f
.long 0x000005f6,0x0000007f
.long 0x00000675,0x0000007f
.long 0x000006f4,0x0000007f
.long 0x00000773,0x0000003f
.long 0x00000000,0x00000000
.org 0x400
#
# Automatically generated make config: don't edit
#
CONFIG_MMU=y
CONFIG_SWAP=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_S390=y
CONFIG_ARCH_S390X=y
#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
#
# General setup
#
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=17
#
# Loadable module support
#
CONFIG_MODULES=y
# CONFIG_MODULE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y
#
# Base setup
#
#
# Processor type and features
#
CONFIG_SMP=y
CONFIG_NR_CPUS=64
# CONFIG_S390_SUPPORT is not set
#
# I/O subsystem configuration
#
CONFIG_MACHCHK_WARNING=y
CONFIG_QDIO=y
# CONFIG_QDIO_PERF_STATS is not set
#
# Misc
#
# CONFIG_PREEMPT is not set
CONFIG_IPL=y
# CONFIG_IPL_TAPE is not set
CONFIG_IPL_VM=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=m
# CONFIG_PROCESS_DEBUG is not set
CONFIG_PFAULT=y
# CONFIG_SHARED_KERNEL is not set
# CONFIG_PCMCIA is not set
#
# SCSI support
#
# CONFIG_SCSI is not set
CONFIG_CCW=y
#
# Block device drivers
#
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_XPRAM=m
#
# S/390 block device drivers
#
CONFIG_DASD=y
# CONFIG_DASD_PROFILE is not set
CONFIG_DASD_ECKD=y
CONFIG_DASD_FBA=y
# CONFIG_DASD_DIAG is not set
#
# Multi-device support (RAID and LVM)
#
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID5=m
CONFIG_MD_MULTIPATH=m
# CONFIG_BLK_DEV_DM is not set
#
# Character device drivers
#
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=2048
#
# S/390 character device drivers
#
# CONFIG_TN3270 is not set
CONFIG_TN3215=y
CONFIG_TN3215_CONSOLE=y
CONFIG_CCW_CONSOLE=y
CONFIG_SCLP=y
CONFIG_SCLP_TTY=y
CONFIG_SCLP_CONSOLE=y
CONFIG_SCLP_CPI=m
CONFIG_S390_TAPE=m
#
# S/390 tape interface support
#
CONFIG_S390_TAPE_BLOCK=y
#
# S/390 tape hardware support
#
CONFIG_S390_TAPE_34XX=m
CONFIG_HOTPLUG=y
#
# Networking support
#
CONFIG_NET=y
#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_NETFILTER is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_MROUTE is not set
# CONFIG_ARPD is not set
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_XFRM_USER is not set
CONFIG_IPV6=m
#
# SCTP Configuration (EXPERIMENTAL)
#
CONFIG_IPV6_SCTP__=m
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_FASTROUTE is not set
# CONFIG_NET_HW_FLOWCONTROL is not set
#
# QoS and/or fair queueing
#
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
# CONFIG_NET_SCH_HTB is not set
CONFIG_NET_SCH_CSZ=m
CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_RED=m
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
CONFIG_NET_QOS=y
CONFIG_NET_ESTIMATOR=y
CONFIG_NET_CLS=y
CONFIG_NET_CLS_TCINDEX=m
CONFIG_NET_CLS_ROUTE4=m
CONFIG_NET_CLS_ROUTE=y
CONFIG_NET_CLS_FW=m
CONFIG_NET_CLS_U32=m
CONFIG_NET_CLS_RSVP=m
CONFIG_NET_CLS_RSVP6=m
CONFIG_NET_CLS_POLICE=y
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NETDEVICES=y
CONFIG_DUMMY=m
CONFIG_BONDING=m
CONFIG_EQUALIZER=m
CONFIG_TUN=m
# CONFIG_ETHERTAP is not set
#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
#
# Ethernet (1000 Mbit)
#
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set
#
# Token Ring devices (depends on LLC=y)
#
# CONFIG_SHAPER is not set
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# S/390 network device drivers
#
CONFIG_LCS=m
CONFIG_CTC=m
CONFIG_IUCV=m
CONFIG_CCWGROUP=m
#
# File systems
#
CONFIG_QUOTA=y
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
# CONFIG_FAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_TMPFS is not set
CONFIG_RAMFS=y
# CONFIG_ISO9660_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UDF_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_XFS_FS is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4 is not set
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V4 is not set
# CONFIG_NFSD_TCP is not set
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_GSS is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y
# CONFIG_CIFS is not set
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_FS_MBCACHE=y
#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
CONFIG_IBM_PARTITION=y
# CONFIG_MAC_PARTITION is not set
# CONFIG_MSDOS_PARTITION is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_KALLSYMS is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
#
# Security options
#
# CONFIG_SECURITY is not set
#
# Cryptographic options
#
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_TEST is not set
#
# Library routines
#
# CONFIG_CRC32 is not set
#
# Makefile for the linux kernel.
#
extra-y := head.o init_task.o
EXTRA_AFLAGS := -traditional
obj-y := entry.o bitmap.o traps.o time.o process.o \
setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
semaphore.o reipl.o s390_ext.o debug.o
obj-$(CONFIG_MODULES) += s390_ksyms.o module.o
obj-$(CONFIG_SMP) += smp.o
#
# Kernel debugging
#
obj-$(CONFIG_REMOTE_DEBUG) += gdb-stub.o #gdb-low.o
obj-$(CONFIG_S390_SUPPORT) += linux32.o signal32.o ioctl32.o wrapper32.o \
exec32.o exec_domain32.o
obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
#
# This is just to get the dependencies...
#
binfmt_elf32.o: $(TOPDIR)/fs/binfmt_elf.c
/*
* Generate definitions needed by assembly language modules.
* This code generates raw asm output which is post-processed to extract
* and format the required data.
*/
#include <linux/config.h>
#include <linux/sched.h>
/* Use marker if you need to separate the values later */
#define DEFINE(sym, val, marker) \
asm volatile("\n->" #sym " %0 " #val " " #marker : : "i" (val))
#define BLANK() asm volatile("\n->" : : )
int main(void)
{
DEFINE(__THREAD_info, offsetof(struct task_struct, thread_info),);
DEFINE(__THREAD_ar2, offsetof(struct task_struct, thread.ar2),);
DEFINE(__THREAD_ar4, offsetof(struct task_struct, thread.ar4),);
DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp),);
DEFINE(__THREAD_per, offsetof(struct task_struct, thread.per_info),);
BLANK();
DEFINE(__TI_task, offsetof(struct thread_info, task),);
DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain),);
DEFINE(__TI_flags, offsetof(struct thread_info, flags),);
DEFINE(__TI_cpu, offsetof(struct thread_info, cpu),);
DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count),);
return 0;
}
/*
* Support for 32-bit Linux for S390 ELF binaries.
*
* Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Gerhard Tonn (ton@de.ibm.com)
*
* Heavily inspired by the 32-bit Sparc compat code which is
* Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@redhat.com)
* Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz)
*/
#define __ASMS390_ELF_H
#include <linux/time.h>
/*
* These are used to set parameters in the core dumps.
*/
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_S390
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#define elf_check_arch(x) \
(((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \
&& (x)->e_ident[EI_CLASS] == ELF_CLASS)
/* ELF register definitions */
#define NUM_GPRS 16
#define NUM_FPRS 16
#define NUM_ACRS 16
#define TASK31_SIZE (0x80000000UL)
/* For SVR4/S390 the function pointer to be registered with `atexit` is
passed in R14. */
#define ELF_PLAT_INIT(_r, load_addr) \
do { \
_r->gprs[14] = 0; \
set_thread_flag(TIF_31BIT); \
} while(0)
#define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE 4096
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
use of this is to invoke "./ld.so someprog" to test out a new version of
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
#define ELF_ET_DYN_BASE (TASK31_SIZE / 3 * 2)
/* Wow, the "main" arch needs arch dependent functions too.. :) */
/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
now struct_user_regs, they are different) */
#define ELF_CORE_COPY_REGS(pr_reg, regs) \
{ \
int i; \
memcpy(&pr_reg.psw.mask, &regs->psw.mask, 4); \
memcpy(&pr_reg.psw.addr, ((char*)&regs->psw.addr)+4, 4); \
for(i=0; i<NUM_GPRS; i++) \
pr_reg.gprs[i] = regs->gprs[i]; \
for(i=0; i<NUM_ACRS; i++) \
pr_reg.acrs[i] = regs->acrs[i]; \
pr_reg.orig_gpr2 = regs->orig_gpr2; \
}
/* This yields a mask that user programs can use to figure out what
instruction set this CPU supports. */
#define ELF_HWCAP (0)
/* This yields a string that ld.so will use to load implementation
specific libraries for optimization. This is more specific in
intent than poking at uname or /proc/cpuinfo.
For the moment, we have only optimizations for the Intel generations,
but that could change... */
#define ELF_PLATFORM (NULL)
#define SET_PERSONALITY(ex, ibcs2) \
do { \
if (ibcs2) \
set_personality(PER_SVR4); \
else if (current->personality != PER_LINUX32) \
set_personality(PER_LINUX); \
} while (0)
#include "linux32.h"
typedef _s390_fp_regs32 elf_fpregset_t;
typedef struct
{
_psw_t32 psw;
__u32 gprs[__NUM_GPRS];
__u32 acrs[__NUM_ACRS];
__u32 orig_gpr2;
} s390_regs32;
typedef s390_regs32 elf_gregset_t;
#include <asm/processor.h>
#include <linux/module.h>
#include <linux/config.h>
#include <linux/elfcore.h>
#include <linux/binfmts.h>
#include <linux/compat.h>
int setup_arg_pages32(struct linux_binprm *bprm);
#define elf_prstatus elf_prstatus32
struct elf_prstatus32
{
struct elf_siginfo pr_info; /* Info associated with signal */
short pr_cursig; /* Current signal */
u32 pr_sigpend; /* Set of pending signals */
u32 pr_sighold; /* Set of held signals */
pid_t pr_pid;
pid_t pr_ppid;
pid_t pr_pgrp;
pid_t pr_sid;
struct compat_timeval pr_utime; /* User time */
struct compat_timeval pr_stime; /* System time */
struct compat_timeval pr_cutime; /* Cumulative user time */
struct compat_timeval pr_cstime; /* Cumulative system time */
elf_gregset_t pr_reg; /* GP registers */
int pr_fpvalid; /* True if math co-processor being used. */
};
#define elf_prpsinfo elf_prpsinfo32
struct elf_prpsinfo32
{
char pr_state; /* numeric process state */
char pr_sname; /* char for pr_state */
char pr_zomb; /* zombie */
char pr_nice; /* nice val */
u32 pr_flag; /* flags */
u16 pr_uid;
u16 pr_gid;
pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
/* Lots missing */
char pr_fname[16]; /* filename of executable */
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
};
#include <linux/highuid.h>
#undef NEW_TO_OLD_UID
#undef NEW_TO_OLD_GID
#define NEW_TO_OLD_UID(uid) ((uid) > 65535) ? (u16)overflowuid : (u16)(uid)
#define NEW_TO_OLD_GID(gid) ((gid) > 65535) ? (u16)overflowgid : (u16)(gid)
#define elf_addr_t u32
/*
#define init_elf_binfmt init_elf32_binfmt
*/
#undef CONFIG_BINFMT_ELF
#ifdef CONFIG_BINFMT_ELF32
#define CONFIG_BINFMT_ELF CONFIG_BINFMT_ELF32
#endif
#undef CONFIG_BINFMT_ELF_MODULE
#ifdef CONFIG_BINFMT_ELF32_MODULE
#define CONFIG_BINFMT_ELF_MODULE CONFIG_BINFMT_ELF32_MODULE
#endif
#undef start_thread
#define start_thread start_thread31
#define setup_arg_pages(bprm) setup_arg_pages32(bprm)
#define elf_map elf_map32
MODULE_DESCRIPTION("Binary format loader for compatibility with 32bit Linux for S390 binaries,"
" Copyright 2000 IBM Corporation");
MODULE_AUTHOR("Gerhard Tonn <ton@de.ibm.com>");
#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR
#define jiffies_to_timeval jiffies_to_compat_timeval
static __inline__ void
jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
{
value->tv_usec = (jiffies % HZ) * (1000000L / HZ);
value->tv_sec = jiffies / HZ;
}
#include "../../../fs/binfmt_elf.c"
static unsigned long
elf_map32 (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type)
{
unsigned long map_addr;
if (!addr)
addr = 0x40000000;
if (prot & PROT_READ)
prot |= PROT_EXEC;
down_write(&current->mm->mmap_sem);
map_addr = do_mmap(filep, ELF_PAGESTART(addr),
eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr),
prot, type,
eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
up_write(&current->mm->mmap_sem);
return(map_addr);
}
/*
* arch/s390/kernel/bitmap.S
* Bitmaps for set_bit, clear_bit, test_and_set_bit, ...
* See include/asm-s390/{bitops.h|posix_types.h} for details
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
.globl _oi_bitmap
_oi_bitmap:
.byte 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
.globl _ni_bitmap
_ni_bitmap:
.byte 0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F
.globl _zb_findmap
_zb_findmap:
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
.byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,8
.globl _sb_findmap
_sb_findmap:
.byte 8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
.byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
/*
* arch/s390/kernel/cpcmd.c
*
* S390 version
* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
#include <linux/string.h>
#include <linux/spinlock.h>
#include <asm/cpcmd.h>
#include <asm/ebcdic.h>
#include <asm/system.h>
static spinlock_t cpcmd_lock = SPIN_LOCK_UNLOCKED;
static char cpcmd_buf[128];
void cpcmd(char *cmd, char *response, int rlen)
{
const int mask = 0x40000000L;
unsigned long flags;
int cmdlen;
spin_lock_irqsave(&cpcmd_lock, flags);
cmdlen = strlen(cmd);
strcpy(cpcmd_buf, cmd);
ASCEBC(cpcmd_buf, cmdlen);
if (response != NULL && rlen > 0) {
asm volatile (" lrag 2,0(%0)\n"
" lgr 4,%1\n"
" o 4,%4\n"
" lrag 3,0(%2)\n"
" lgr 5,%3\n"
" sam31\n"
" .long 0x83240008 # Diagnose 83\n"
" sam64"
: /* no output */
: "a" (cpcmd_buf), "d" (cmdlen),
"a" (response), "d" (rlen), "m" (mask)
: "2", "3", "4", "5" );
EBCASC(response, rlen);
} else {
asm volatile (" lrag 2,0(%0)\n"
" lgr 3,%1\n"
" sam31\n"
" .long 0x83230008 # Diagnose 83\n"
" sam64"
: /* no output */
: "a" (cpcmd_buf), "d" (cmdlen)
: "2", "3" );
}
spin_unlock_irqrestore(&cpcmd_lock, flags);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Support for 32-bit Linux for S390 ELF binaries.
*
* Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Gerhard Tonn (ton@de.ibm.com)
*
* Separated from binfmt_elf32.c to reduce exports for module enablement.
*
*/
#include <linux/config.h>
#include <linux/slab.h>
#include <linux/file.h>
#include <linux/mman.h>
#include <linux/a.out.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/pagemap.h>
#include <linux/highmem.h>
#include <linux/spinlock.h>
#include <linux/binfmts.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
extern void put_dirty_page(struct task_struct * tsk, struct page *page, unsigned long address);
#undef STACK_TOP
#define STACK_TOP TASK31_SIZE
int setup_arg_pages32(struct linux_binprm *bprm)
{
unsigned long stack_base;
struct vm_area_struct *mpnt;
struct mm_struct *mm = current->mm;
int i;
stack_base = STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
mm->arg_start = bprm->p + stack_base;
bprm->p += stack_base;
if (bprm->loader)
bprm->loader += stack_base;
bprm->exec += stack_base;
mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
if (!mpnt)
return -ENOMEM;
if (!vm_enough_memory((STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
kmem_cache_free(vm_area_cachep, mpnt);
return -ENOMEM;
}
down_write(&mm->mmap_sem);
{
mpnt->vm_mm = mm;
mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
mpnt->vm_end = STACK_TOP;
mpnt->vm_page_prot = PAGE_COPY;
mpnt->vm_flags = VM_STACK_FLAGS;
mpnt->vm_ops = NULL;
mpnt->vm_pgoff = 0;
mpnt->vm_file = NULL;
INIT_LIST_HEAD(&mpnt->shared);
mpnt->vm_private_data = (void *) 0;
insert_vm_struct(mm, mpnt);
mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
}
for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
struct page *page = bprm->page[i];
if (page) {
bprm->page[i] = NULL;
put_dirty_page(current,page,stack_base);
}
stack_base += PAGE_SIZE;
}
up_write(&mm->mmap_sem);
return 0;
}
EXPORT_SYMBOL(setup_arg_pages32);
/*
* Support for 32-bit Linux for S390 personality.
*
* Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Gerhard Tonn (ton@de.ibm.com)
*
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/personality.h>
#include <linux/sched.h>
struct exec_domain s390_exec_domain;
static int __init
s390_init (void)
{
s390_exec_domain.name = "Linux/s390";
s390_exec_domain.handler = NULL;
s390_exec_domain.pers_low = PER_LINUX32;
s390_exec_domain.pers_high = PER_LINUX32;
s390_exec_domain.signal_map = default_exec_domain.signal_map;
s390_exec_domain.signal_invmap = default_exec_domain.signal_invmap;
register_exec_domain(&s390_exec_domain);
return 0;
}
__initcall(s390_init);
This diff is collapsed.
This diff is collapsed.
/*
* arch/s390/kernel/ieee.h
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
#include <linux/sched.h>
static inline void _adddf(int R1,int R2)
{
current->tss.fprs[R1].fd = current->tss.fprs[R1].fd +
current->tss.fprs[R2].fd;
}
static inline void _subdf(int R1,int R2)
{
current->tss.fprs[R1].fd = current->tss.fprs[R1].fd -
current->tss.fprs[R2].fd;
}
static inline void _muldf(int R1,int R2)
{
current->tss.fprs[R1].fd = current->tss.fprs[R1].fd *
current->tss.fprs[R2].fd;
}
static inline void _divdf(int R1,int R2)
{
current->tss.fprs[R1].fd = current->tss.fprs[R1].fd /
current->tss.fprs[R2].fd;
}
static inline void _negdf(int R1,int R2)
{
current->tss.fprs[R1].fd = -current->tss.fprs[R1].fd;
}
static inline void _fixdfsi(int R1,int R2)
{
current->tss.regs->gprs[R1] = (__u32) current->tss.fprs[R2].fd;
}
static inline void _extendsidf(int R1,int R2)
{
current->tss.fprs[R1].fd = (double) current->tss.regs->gprs[R2];
}
static inline void _addsf(int R1,int R2)
{
current->tss.fprs[R1].ff = current->tss.fprs[R1].ff +
current->tss.fprs[R2].ff;
}
static inline void _subsf(int R1,int R2)
{
current->tss.fprs[R1].ff = current->tss.fprs[R1].ff -
current->tss.fprs[R2].ff;
}
static inline void _mulsf(int R1,int R2)
{
current->tss.fprs[R1].ff = current->tss.fprs[R1].ff *
current->tss.fprs[R2].ff;
}
static inline void _divsf(int R1,int R2)
{
current->tss.fprs[R1].ff = current->tss.fprs[R1].ff /
current->tss.fprs[R2].ff;
}
static inline void _negsf(int R1,int R2)
{
current->tss.fprs[R1].ff = -current->tss.fprs[R1].ff;
}
static inline void _fixsfsi(int R1,int R2)
{
current->tss.regs->gprs[R1] = (__u32) current->tss.fprs[R2].ff;
}
static inline void _extendsisf(int R1,int R2)
{
current->tss.fprs[R1].ff = (double) current->tss.regs->gprs[R2];
}
/*
* arch/s390/kernel/init_task.c
*
* S390 version
*
* Derived from "arch/i386/kernel/init_task.c"
*/
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/init_task.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
/*
* Initial thread structure.
*
* We need to make sure that this is 8192-byte aligned due to the
* way process stacks are handled. This is done by having a special
* "init_task" linker map entry..
*/
union thread_union init_thread_union
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
* Initial task structure.
*
* All other task structs will be allocated on slabs in fork.c
*/
struct task_struct init_task = INIT_TASK(init_task);
This diff is collapsed.
This diff is collapsed.
#ifndef _ASM_S390X_S390_H
#define _ASM_S390X_S390_H
#include <linux/config.h>
#include <linux/compat.h>
#include <linux/socket.h>
#include <linux/nfs_fs.h>
#include <linux/sunrpc/svc.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/export.h>
/* Macro that masks the high order bit of an 32 bit pointer and converts it*/
/* to a 64 bit pointer */
#define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL))
#define AA(__x) \
((unsigned long)(__x))
/* Now 32bit compatibility types */
struct ipc_kludge_32 {
__u32 msgp; /* pointer */
__s32 msgtyp;
};
struct old_sigaction32 {
__u32 sa_handler; /* Really a pointer, but need to deal with 32 bits */
compat_old_sigset_t sa_mask; /* A 32 bit mask */
__u32 sa_flags;
__u32 sa_restorer; /* Another 32 bit pointer */
};
typedef union sigval32 {
int sival_int;
__u32 sival_ptr;
} sigval_t32;
typedef struct siginfo32 {
int si_signo;
int si_errno;
int si_code;
union {
int _pad[((128/sizeof(int)) - 3)];
/* kill() */
struct {
pid_t _pid; /* sender's pid */
uid_t _uid; /* sender's uid */
} _kill;
/* POSIX.1b timers */
struct {
unsigned int _timer1;
unsigned int _timer2;
} _timer;
/* POSIX.1b signals */
struct {
pid_t _pid; /* sender's pid */
uid_t _uid; /* sender's uid */
sigval_t32 _sigval;
} _rt;
/* SIGCHLD */
struct {
pid_t _pid; /* which child */
uid_t _uid; /* sender's uid */
int _status;/* exit code */
compat_clock_t _utime;
compat_clock_t _stime;
} _sigchld;
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
struct {
__u32 _addr; /* faulting insn/memory ref. - pointer */
} _sigfault;
/* SIGPOLL */
struct {
int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
int _fd;
} _sigpoll;
} _sifields;
} siginfo_t32;
/*
* How these fields are to be accessed.
*/
#define si_pid _sifields._kill._pid
#define si_uid _sifields._kill._uid
#define si_status _sifields._sigchld._status
#define si_utime _sifields._sigchld._utime
#define si_stime _sifields._sigchld._stime
#define si_value _sifields._rt._sigval
#define si_int _sifields._rt._sigval.sival_int
#define si_ptr _sifields._rt._sigval.sival_ptr
#define si_addr _sifields._sigfault._addr
#define si_band _sifields._sigpoll._band
#define si_fd _sifields._sigpoll._fd
/* asm/sigcontext.h */
typedef union
{
__u64 d;
__u32 f;
} freg_t32;
typedef struct
{
unsigned int fpc;
freg_t32 fprs[__NUM_FPRS];
} _s390_fp_regs32;
typedef struct
{
__u32 mask;
__u32 addr;
} _psw_t32 __attribute__ ((aligned(8)));
#define PSW32_MASK_PER 0x40000000UL
#define PSW32_MASK_DAT 0x04000000UL
#define PSW32_MASK_IO 0x02000000UL
#define PSW32_MASK_EXT 0x01000000UL
#define PSW32_MASK_KEY 0x00F00000UL
#define PSW32_MASK_MCHECK 0x00040000UL
#define PSW32_MASK_WAIT 0x00020000UL
#define PSW32_MASK_PSTATE 0x00010000UL
#define PSW32_MASK_ASC 0x0000C000UL
#define PSW32_MASK_CC 0x00003000UL
#define PSW32_MASK_PM 0x00000f00UL
#define PSW32_ADDR_AMODE31 0x80000000UL
#define PSW32_ADDR_INSN 0x7FFFFFFFUL
#define PSW32_BASE_BITS 0x00080000UL
#define PSW32_ASC_PRIMARY 0x00000000UL
#define PSW32_ASC_ACCREG 0x00004000UL
#define PSW32_ASC_SECONDARY 0x00008000UL
#define PSW32_ASC_HOME 0x0000C000UL
#define PSW32_USER_BITS (PSW32_BASE_BITS | PSW32_MASK_DAT | PSW32_ASC_HOME | \
PSW32_MASK_IO | PSW32_MASK_EXT | PSW32_MASK_MCHECK | \
PSW32_MASK_PSTATE)
typedef struct
{
_psw_t32 psw;
__u32 gprs[__NUM_GPRS];
__u32 acrs[__NUM_ACRS];
} _s390_regs_common32;
typedef struct
{
_s390_regs_common32 regs;
_s390_fp_regs32 fpregs;
} _sigregs32;
#define _SIGCONTEXT_NSIG32 64
#define _SIGCONTEXT_NSIG_BPW32 32
#define __SIGNAL_FRAMESIZE32 96
#define _SIGMASK_COPY_SIZE32 (sizeof(u32)*2)
struct sigcontext32
{
__u32 oldmask[_COMPAT_NSIG_WORDS];
__u32 sregs; /* pointer */
};
/* asm/signal.h */
struct sigaction32 {
__u32 sa_handler; /* pointer */
__u32 sa_flags;
__u32 sa_restorer; /* pointer */
compat_sigset_t sa_mask; /* mask last for extensibility */
};
typedef struct {
__u32 ss_sp; /* pointer */
int ss_flags;
compat_size_t ss_size;
} stack_t32;
/* asm/ucontext.h */
struct ucontext32 {
__u32 uc_flags;
__u32 uc_link; /* pointer */
stack_t32 uc_stack;
_sigregs32 uc_mcontext;
compat_sigset_t uc_sigmask; /* mask last for extensibility */
};
#endif /* _ASM_S390X_S390_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _PTRACE32_H
#define _PTRACE32_H
#include "linux32.h" /* needed for _psw_t32 */
typedef struct
{
__u32 cr[3];
} per_cr_words32 __attribute__((packed));
typedef struct
{
__u16 perc_atmid; /* 0x096 */
__u32 address; /* 0x098 */
__u8 access_id; /* 0x0a1 */
} per_lowcore_words32 __attribute__((packed));
typedef struct
{
union {
per_cr_words32 words;
} control_regs __attribute__((packed));
/*
* Use these flags instead of setting em_instruction_fetch
* directly they are used so that single stepping can be
* switched on & off while not affecting other tracing
*/
unsigned single_step : 1;
unsigned instruction_fetch : 1;
unsigned : 30;
/*
* These addresses are copied into cr10 & cr11 if single
* stepping is switched off
*/
__u32 starting_addr;
__u32 ending_addr;
union {
per_lowcore_words32 words;
} lowcore;
} per_struct32 __attribute__((packed));
struct user_regs_struct32
{
_psw_t32 psw;
u32 gprs[NUM_GPRS];
u32 acrs[NUM_ACRS];
u32 orig_gpr2;
s390_fp_regs fp_regs;
/*
* These per registers are in here so that gdb can modify them
* itself as there is no "official" ptrace interface for hardware
* watchpoints. This is the way intel does it.
*/
per_struct32 per_info;
u32 ieee_instruction_pointer;
/* Used to give failing instruction back to user for ieee exceptions */
};
struct user32 {
/* We start with the registers, to mimic the way that "memory"
is returned from the ptrace(3,...) function. */
struct user_regs_struct32 regs; /* Where the registers are actually stored */
/* The rest of this junk is to help gdb figure out what goes where */
u32 u_tsize; /* Text segment size (pages). */
u32 u_dsize; /* Data segment size (pages). */
u32 u_ssize; /* Stack segment size (pages). */
u32 start_code; /* Starting virtual address of text. */
u32 start_stack; /* Starting virtual address of stack area.
This is actually the bottom of the stack,
the top of the stack is always found in the
esp register. */
s32 signal; /* Signal that caused the core dump. */
u32 u_ar0; /* Used by gdb to help find the values for */
/* the registers. */
u32 magic; /* To uniquely identify a core file */
char u_comm[32]; /* User command that was responsible */
};
typedef struct
{
__u32 len;
__u32 kernel_addr;
__u32 process_addr;
} ptrace_area_emu31;
#endif /* _PTRACE32_H */
This diff is collapsed.
This diff is collapsed.
/*
* arch/s390/kernel/s390_ksyms.c
*
* S390 version
*/
#include <linux/config.h>
#include <linux/highuid.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <asm/checksum.h>
#include <asm/delay.h>
#include <asm/pgalloc.h>
#include <asm/setup.h>
#if CONFIG_IP_MULTICAST
#include <net/arp.h>
#endif
/*
* memory management
*/
EXPORT_SYMBOL_NOVERS(_oi_bitmap);
EXPORT_SYMBOL_NOVERS(_ni_bitmap);
EXPORT_SYMBOL_NOVERS(_zb_findmap);
EXPORT_SYMBOL_NOVERS(__copy_from_user_asm);
EXPORT_SYMBOL_NOVERS(__copy_to_user_asm);
EXPORT_SYMBOL_NOVERS(__clear_user_asm);
/*
* semaphore ops
*/
EXPORT_SYMBOL(__up);
EXPORT_SYMBOL(__down);
EXPORT_SYMBOL(__down_interruptible);
/*
* string functions
*/
EXPORT_SYMBOL_NOVERS(memcmp);
EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL_NOVERS(memmove);
EXPORT_SYMBOL_NOVERS(memscan);
EXPORT_SYMBOL_NOVERS(strlen);
EXPORT_SYMBOL_NOVERS(strchr);
EXPORT_SYMBOL_NOVERS(strcmp);
EXPORT_SYMBOL_NOVERS(strncat);
EXPORT_SYMBOL_NOVERS(strncmp);
EXPORT_SYMBOL_NOVERS(strncpy);
EXPORT_SYMBOL_NOVERS(strnlen);
EXPORT_SYMBOL_NOVERS(strrchr);
EXPORT_SYMBOL_NOVERS(strstr);
EXPORT_SYMBOL_NOVERS(strpbrk);
/*
* binfmt_elf loader
*/
extern int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(overflowuid);
EXPORT_SYMBOL(overflowgid);
#ifdef CONFIG_S390_SUPPORT
/*
* Dynamically add/remove 31 bit ioctl conversion functions.
*/
extern int register_ioctl32_conversion(unsigned int cmd,
int (*handler)(unsigned int,
unsigned int,
unsigned long,
struct file *));
int unregister_ioctl32_conversion(unsigned int cmd);
EXPORT_SYMBOL(register_ioctl32_conversion);
EXPORT_SYMBOL(unregister_ioctl32_conversion);
#endif
/*
* misc.
*/
EXPORT_SYMBOL(machine_flags);
EXPORT_SYMBOL(__udelay);
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(console_mode);
EXPORT_SYMBOL(console_device);
EXPORT_SYMBOL_NOVERS(do_call_softirq);
EXPORT_SYMBOL(sys_wait4);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# Makefile for the linux s390-specific parts of the memory manager.
#
obj-y := init.o fault.o ioremap.o extable.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment