Skip to content

Commit

Permalink
sh: Consolidate the sh64 changes in arch/sh/boot/compressed/misc_32.c
Browse files Browse the repository at this point in the history
This makes some minor changes to misc_32.c so that it can be used by
sh64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Jul 11, 2009
1 parent 07e88e1 commit b14c6d4
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions arch/sh/boot/compressed/misc_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
#undef memcpy
#define memzero(s, n) memset ((s), 0, (n))

static void error(char *m);
/* cache.c */
#define CACHE_ENABLE 0
#define CACHE_DISABLE 1
int cache_control(unsigned int command);

extern char input_data[];
extern int input_len;
Expand Down Expand Up @@ -111,9 +114,15 @@ static void error(char *x)
while(1); /* Halt */
}

#ifdef CONFIG_SUPERH64
#define stackalign 8
#else
#define stackalign 4
#endif

#define STACK_SIZE (4096)
long user_stack [STACK_SIZE];
long* stack_start = &user_stack[STACK_SIZE];
long __attribute__ ((aligned(stackalign))) user_stack[STACK_SIZE];
long *stack_start = &user_stack[STACK_SIZE];

void decompress_kernel(void)
{
Expand All @@ -129,6 +138,8 @@ void decompress_kernel(void)
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;

puts("Uncompressing Linux... ");
cache_control(CACHE_ENABLE);
decompress(input_data, input_len, NULL, NULL, output, NULL, error);
cache_control(CACHE_DISABLE);
puts("Ok, booting the kernel.\n");
}

0 comments on commit b14c6d4

Please sign in to comment.