Commit 159d1ff8 authored by Frank Munzert's avatar Frank Munzert Committed by Martin Schwidefsky

[S390] Use csum_partial in checksum.h

The cksm function in system.h is duplicate to csum_partial in checksum.h.
Remove cksm and use csum_partial instead.
Signed-off-by: default avatarFrank Munzert <munzert@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 866ba284
...@@ -458,22 +458,6 @@ static inline unsigned short stap(void) ...@@ -458,22 +458,6 @@ static inline unsigned short stap(void)
return cpu_address; return cpu_address;
} }
static inline u32 cksm(void *addr, unsigned long len)
{
register unsigned long _addr asm("0") = (unsigned long) addr;
register unsigned long _len asm("1") = len;
unsigned long accu = 0;
asm volatile(
"0:\n"
" cksm %0,%1\n"
" jnz 0b\n"
: "+d" (accu), "+d" (_addr), "+d" (_len)
:
: "cc", "memory");
return accu;
}
extern void (*_machine_restart)(char *command); extern void (*_machine_restart)(char *command);
extern void (*_machine_halt)(void); extern void (*_machine_halt)(void);
extern void (*_machine_power_off)(void); extern void (*_machine_power_off)(void);
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/reset.h> #include <asm/reset.h>
#include <asm/sclp.h> #include <asm/sclp.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/checksum.h>
#define IPL_PARM_BLOCK_VERSION 0 #define IPL_PARM_BLOCK_VERSION 0
...@@ -1359,7 +1360,8 @@ static void dump_reipl_run(struct shutdown_trigger *trigger) ...@@ -1359,7 +1360,8 @@ static void dump_reipl_run(struct shutdown_trigger *trigger)
"a" (&lowcore_ptr[smp_processor_id()]->ipib)); "a" (&lowcore_ptr[smp_processor_id()]->ipib));
#endif #endif
asm volatile("stura %0,%1" asm volatile("stura %0,%1"
:: "a" (cksm(reipl_block_actual, reipl_block_actual->hdr.len)), :: "a" (csum_partial(reipl_block_actual,
reipl_block_actual->hdr.len, 0)),
"a" (&lowcore_ptr[smp_processor_id()]->ipib_checksum)); "a" (&lowcore_ptr[smp_processor_id()]->ipib_checksum));
preempt_enable(); preempt_enable();
dump_run(trigger); dump_run(trigger);
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/debug.h> #include <asm/debug.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/irqflags.h> #include <asm/irqflags.h>
#include <asm/checksum.h>
#include "sclp.h" #include "sclp.h"
#define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x) #define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x)
...@@ -704,7 +705,8 @@ static int __init zcore_reipl_init(void) ...@@ -704,7 +705,8 @@ static int __init zcore_reipl_init(void)
free_page((unsigned long) ipl_block); free_page((unsigned long) ipl_block);
return rc; return rc;
} }
if (cksm(ipl_block, ipl_block->hdr.len) != ipib_info.checksum) { if (csum_partial(ipl_block, ipl_block->hdr.len, 0) !=
ipib_info.checksum) {
TRACE("Checksum does not match\n"); TRACE("Checksum does not match\n");
free_page((unsigned long) ipl_block); free_page((unsigned long) ipl_block);
ipl_block = NULL; ipl_block = NULL;
......
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