diff options
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/arch-v10/boot/compressed/misc.c | 36 | ||||
-rw-r--r-- | arch/cris/arch-v32/boot/compressed/misc.c | 39 |
2 files changed, 4 insertions, 71 deletions
diff --git a/arch/cris/arch-v10/boot/compressed/misc.c b/arch/cris/arch-v10/boot/compressed/misc.c index 18e13bce1400..d933c89889db 100644 --- a/arch/cris/arch-v10/boot/compressed/misc.c +++ b/arch/cris/arch-v10/boot/compressed/misc.c | |||
@@ -102,50 +102,16 @@ extern char *input_data; /* lives in head.S */ | |||
102 | static long bytes_out = 0; | 102 | static long bytes_out = 0; |
103 | static uch *output_data; | 103 | static uch *output_data; |
104 | static unsigned long output_ptr = 0; | 104 | static unsigned long output_ptr = 0; |
105 | |||
106 | static void *malloc(int size); | ||
107 | static void free(void *where); | ||
108 | static void gzip_mark(void **); | ||
109 | static void gzip_release(void **); | ||
110 | |||
111 | static void puts(const char *); | 105 | static void puts(const char *); |
112 | 106 | ||
113 | /* the "heap" is put directly after the BSS ends, at end */ | 107 | /* the "heap" is put directly after the BSS ends, at end */ |
114 | 108 | ||
115 | extern int _end; | 109 | extern int _end; |
116 | static long free_mem_ptr = (long)&_end; | 110 | static long free_mem_ptr = (long)&_end; |
111 | static long free_mem_end_ptr; | ||
117 | 112 | ||
118 | #include "../../../../../lib/inflate.c" | 113 | #include "../../../../../lib/inflate.c" |
119 | 114 | ||
120 | static void *malloc(int size) | ||
121 | { | ||
122 | void *p; | ||
123 | |||
124 | if (size < 0) | ||
125 | error("Malloc error"); | ||
126 | |||
127 | free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */ | ||
128 | |||
129 | p = (void *)free_mem_ptr; | ||
130 | free_mem_ptr += size; | ||
131 | |||
132 | return p; | ||
133 | } | ||
134 | |||
135 | static void free(void *where) | ||
136 | { /* Don't care */ | ||
137 | } | ||
138 | |||
139 | static void gzip_mark(void **ptr) | ||
140 | { | ||
141 | *ptr = (void *) free_mem_ptr; | ||
142 | } | ||
143 | |||
144 | static void gzip_release(void **ptr) | ||
145 | { | ||
146 | free_mem_ptr = (long) *ptr; | ||
147 | } | ||
148 | |||
149 | /* decompressor info and error messages to serial console */ | 115 | /* decompressor info and error messages to serial console */ |
150 | 116 | ||
151 | static void | 117 | static void |
diff --git a/arch/cris/arch-v32/boot/compressed/misc.c b/arch/cris/arch-v32/boot/compressed/misc.c index 55b2695c5d70..3595e16e82bc 100644 --- a/arch/cris/arch-v32/boot/compressed/misc.c +++ b/arch/cris/arch-v32/boot/compressed/misc.c | |||
@@ -89,20 +89,14 @@ static unsigned outcnt = 0; /* bytes in output buffer */ | |||
89 | 89 | ||
90 | static void flush_window(void); | 90 | static void flush_window(void); |
91 | static void error(char *m); | 91 | static void error(char *m); |
92 | static void gzip_mark(void **); | ||
93 | static void gzip_release(void **); | ||
94 | 92 | ||
95 | extern char *input_data; /* lives in head.S */ | 93 | extern char *input_data; /* lives in head.S */ |
96 | 94 | ||
97 | static long bytes_out = 0; | 95 | static long bytes_out; |
98 | static uch *output_data; | 96 | static uch *output_data; |
99 | static unsigned long output_ptr = 0; | 97 | static unsigned long output_ptr; |
100 | 98 | ||
101 | static void *malloc(int size); | ||
102 | static void free(void *where); | ||
103 | static void error(char *m); | 99 | static void error(char *m); |
104 | static void gzip_mark(void **); | ||
105 | static void gzip_release(void **); | ||
106 | 100 | ||
107 | static void puts(const char *); | 101 | static void puts(const char *); |
108 | 102 | ||
@@ -110,37 +104,10 @@ static void puts(const char *); | |||
110 | 104 | ||
111 | extern int _end; | 105 | extern int _end; |
112 | static long free_mem_ptr = (long)&_end; | 106 | static long free_mem_ptr = (long)&_end; |
107 | static long free_mem_end_ptr; | ||
113 | 108 | ||
114 | #include "../../../../../lib/inflate.c" | 109 | #include "../../../../../lib/inflate.c" |
115 | 110 | ||
116 | static void *malloc(int size) | ||
117 | { | ||
118 | void *p; | ||
119 | |||
120 | if (size <0) error("Malloc error"); | ||
121 | |||
122 | free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */ | ||
123 | |||
124 | p = (void *)free_mem_ptr; | ||
125 | free_mem_ptr += size; | ||
126 | |||
127 | return p; | ||
128 | } | ||
129 | |||
130 | static void free(void *where) | ||
131 | { /* Don't care */ | ||
132 | } | ||
133 | |||
134 | static void gzip_mark(void **ptr) | ||
135 | { | ||
136 | *ptr = (void *) free_mem_ptr; | ||
137 | } | ||
138 | |||
139 | static void gzip_release(void **ptr) | ||
140 | { | ||
141 | free_mem_ptr = (long) *ptr; | ||
142 | } | ||
143 | |||
144 | /* decompressor info and error messages to serial console */ | 111 | /* decompressor info and error messages to serial console */ |
145 | 112 | ||
146 | static inline void | 113 | static inline void |