Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] Cleanup memory_chunk array usage.

Need this at yet another file and don't want to add yet another
extern...

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
36a2bd42 baf2aeb3

+19 -16
+1 -1
arch/s390/kernel/head31.S
··· 157 157 slr %r4,%r4 # set start of chunk to zero 158 158 slr %r5,%r5 # set end of chunk to zero 159 159 slr %r6,%r6 # set access code to zero 160 - la %r10, MEMORY_CHUNKS # number of chunks 160 + la %r10,MEMORY_CHUNKS # number of chunks 161 161 .Lloop: 162 162 tprot 0(%r5),0 # test protection of first byte 163 163 ipm %r7
+2 -5
arch/s390/kernel/setup.c
··· 64 64 unsigned int console_irq = -1; 65 65 unsigned long memory_size = 0; 66 66 unsigned long machine_flags = 0; 67 - struct { 68 - unsigned long addr, size, type; 69 - } memory_chunk[MEMORY_CHUNKS] = { { 0 } }; 70 - #define CHUNK_READ_WRITE 0 71 - #define CHUNK_READ_ONLY 1 67 + 68 + struct mem_chunk memory_chunk[MEMORY_CHUNKS]; 72 69 volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ 73 70 unsigned long __initdata zholes_size[MAX_NR_ZONES]; 74 71 static unsigned long __initdata memory_end;
+4 -7
arch/s390/mm/extmem.c
··· 14 14 #include <linux/slab.h> 15 15 #include <linux/module.h> 16 16 #include <linux/bootmem.h> 17 + #include <linux/ctype.h> 17 18 #include <asm/page.h> 18 19 #include <asm/ebcdic.h> 19 20 #include <asm/errno.h> 20 21 #include <asm/extmem.h> 21 22 #include <asm/cpcmd.h> 22 - #include <linux/ctype.h> 23 + #include <asm/setup.h> 23 24 24 25 #define DCSS_DEBUG /* Debug messages on/off */ 25 26 ··· 82 81 static struct list_head dcss_list = LIST_HEAD_INIT(dcss_list); 83 82 static char *segtype_string[] = { "SW", "EW", "SR", "ER", "SN", "EN", "SC", 84 83 "EW/EN-MIXED" }; 85 - 86 - extern struct { 87 - unsigned long addr, size, type; 88 - } memory_chunk[MEMORY_CHUNKS]; 89 84 90 85 /* 91 86 * Create the 8 bytes, ebcdic VM segment name from ··· 246 249 { 247 250 int i; 248 251 249 - for (i=0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { 250 - if (memory_chunk[i].type != 0) 252 + for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { 253 + if (memory_chunk[i].type != CHUNK_READ_WRITE) 251 254 continue; 252 255 if ((memory_chunk[i].addr >> 20) > (seg->end >> 20)) 253 256 continue;
+12 -3
include/asm-s390/setup.h
··· 2 2 * include/asm-s390/setup.h 3 3 * 4 4 * S390 version 5 - * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 + * Copyright IBM Corp. 1999,2006 6 6 */ 7 7 8 8 #ifndef _ASM_S390_SETUP_H ··· 30 30 #endif /* __s390x__ */ 31 31 #define COMMAND_LINE ((char *) (0x10480)) 32 32 33 + #define CHUNK_READ_WRITE 0 34 + #define CHUNK_READ_ONLY 1 35 + 36 + struct mem_chunk { 37 + unsigned long addr; 38 + unsigned long size; 39 + unsigned long type; 40 + }; 41 + 42 + extern struct mem_chunk memory_chunk[]; 43 + 33 44 /* 34 45 * Machine features detected in head.S 35 46 */ ··· 64 53 #define MACHINE_HAS_MVCOS (machine_flags & 512) 65 54 #endif /* __s390x__ */ 66 55 67 - 68 56 #define MACHINE_HAS_SCLP (!MACHINE_IS_P390) 69 57 70 58 /* ··· 80 70 #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0) 81 71 #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) 82 72 #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) 83 - 84 73 85 74 struct ipl_list_hdr { 86 75 u32 len;