Commit dffdf0a5 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390: core changes

From: Christian Bornträger <cborntra@de.ibm.com>
From: Heiko Carstens <heiko.carstens@de.ibm.com>
From: Michael Holzheu <holzheu@de.ibm.com>
From: Martin Schwidefsky <schwidefsky@de.ibm.com>

s390 core changes:
 - Export arch_pick_mmap_layout as GPL symbol for binfmt_elf32.
 - Remove unnecessary include from cmm.
 - Allow only root to read the debug feature logs.
 - Register all RAM resources, this fixes output of /proc/iomem.
 - Add read_can_lock and write_can_lock primitives.
 - Regenerate default configuration.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3e8d86af
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.11-rc1 # Linux kernel version: 2.6.11-rc2
# Fri Jan 14 14:56:51 2005 # Mon Jan 31 16:27:12 2005
# #
CONFIG_MMU=y CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y
...@@ -156,6 +156,7 @@ CONFIG_CCW=y ...@@ -156,6 +156,7 @@ CONFIG_CCW=y
# #
# Block devices # Block devices
# #
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_LOOP=m
# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_NBD=m
...@@ -579,5 +580,5 @@ CONFIG_CRYPTO=y ...@@ -579,5 +580,5 @@ CONFIG_CRYPTO=y
# Library routines # Library routines
# #
# CONFIG_CRC_CCITT is not set # CONFIG_CRC_CCITT is not set
# CONFIG_CRC32 is not set CONFIG_CRC32=m
# CONFIG_LIBCRC32C is not set # CONFIG_LIBCRC32C is not set
...@@ -931,7 +931,7 @@ int debug_register_view(debug_info_t * id, struct debug_view *view) ...@@ -931,7 +931,7 @@ int debug_register_view(debug_info_t * id, struct debug_view *view)
int rc = 0; int rc = 0;
int i; int i;
unsigned long flags; unsigned long flags;
mode_t mode = S_IFREG; mode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
struct proc_dir_entry *pde; struct proc_dir_entry *pde;
if (!id) if (!id)
......
...@@ -76,8 +76,15 @@ extern int _text,_etext, _edata, _end; ...@@ -76,8 +76,15 @@ extern int _text,_etext, _edata, _end;
static char command_line[COMMAND_LINE_SIZE] = { 0, }; static char command_line[COMMAND_LINE_SIZE] = { 0, };
static struct resource code_resource = { "Kernel code", 0x100000, 0 }; static struct resource code_resource = {
static struct resource data_resource = { "Kernel data", 0, 0 }; .name = "Kernel code",
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
};
static struct resource data_resource = {
.name = "Kernel data",
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
};
/* /*
* cpu_init() initializes state that is per-CPU. * cpu_init() initializes state that is per-CPU.
...@@ -314,7 +321,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -314,7 +321,6 @@ void __init setup_arch(char **cmdline_p)
unsigned long bootmap_size; unsigned long bootmap_size;
unsigned long memory_start, memory_end; unsigned long memory_start, memory_end;
char c = ' ', cn, *to = command_line, *from = COMMAND_LINE; char c = ' ', cn, *to = command_line, *from = COMMAND_LINE;
struct resource *res;
unsigned long start_pfn, end_pfn; unsigned long start_pfn, end_pfn;
static unsigned int smptrap=0; static unsigned int smptrap=0;
unsigned long delay = 0; unsigned long delay = 0;
...@@ -472,6 +478,30 @@ void __init setup_arch(char **cmdline_p) ...@@ -472,6 +478,30 @@ void __init setup_arch(char **cmdline_p)
} }
#endif #endif
for (i = 0; i < 16 && memory_chunk[i].size > 0; i++) {
struct resource *res;
res = alloc_bootmem_low(sizeof(struct resource));
res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
switch (memory_chunk[i].type) {
case CHUNK_READ_WRITE:
res->name = "System RAM";
break;
case CHUNK_READ_ONLY:
res->name = "System ROM";
res->flags |= IORESOURCE_READONLY;
break;
default:
res->name = "reserved";
}
res->start = memory_chunk[i].addr;
res->end = memory_chunk[i].addr + memory_chunk[i].size - 1;
request_resource(&iomem_resource, res);
request_resource(res, &code_resource);
request_resource(res, &data_resource);
}
/* /*
* Setup lowcore for boot cpu * Setup lowcore for boot cpu
*/ */
...@@ -524,14 +554,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -524,14 +554,6 @@ void __init setup_arch(char **cmdline_p)
*/ */
paging_init(); paging_init();
res = alloc_bootmem_low(sizeof(struct resource));
res->start = 0;
res->end = memory_end;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
request_resource(&iomem_resource, res);
request_resource(res, &code_resource);
request_resource(res, &data_resource);
/* Setup default console */ /* Setup default console */
conmode_default(); conmode_default();
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/smp.h>
#include "../../../drivers/s390/net/smsgiucv.h" #include "../../../drivers/s390/net/smsgiucv.h"
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h>
/* /*
* Top of mmap area (just below the process stack). * Top of mmap area (just below the process stack).
...@@ -81,3 +82,5 @@ void arch_pick_mmap_layout(struct mm_struct *mm) ...@@ -81,3 +82,5 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
mm->unmap_area = arch_unmap_area_topdown; mm->unmap_area = arch_unmap_area_topdown;
} }
} }
EXPORT_SYMBOL_GPL(arch_pick_mmap_layout);
...@@ -117,6 +117,18 @@ typedef struct { ...@@ -117,6 +117,18 @@ typedef struct {
#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0) #define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0)
/**
* read_can_lock - would read_trylock() succeed?
* @lock: the rwlock in question.
*/
#define read_can_lock(x) ((int)(x)->lock >= 0)
/**
* write_can_lock - would write_trylock() succeed?
* @lock: the rwlock in question.
*/
#define write_can_lock(x) ((x)->lock == 0)
#ifndef __s390x__ #ifndef __s390x__
#define _raw_read_lock(rw) \ #define _raw_read_lock(rw) \
asm volatile(" l 2,0(%1)\n" \ asm volatile(" l 2,0(%1)\n" \
......
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