1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
diff --git a/apps/codecs/libtremor/os.h b/apps/codecs/libtremor/os.h
index bb4b867..bafcaed 100644
--- a/apps/codecs/libtremor/os.h
+++ b/apps/codecs/libtremor/os.h
@@ -25,7 +25,7 @@

 #  ifdef __GNUC__
 #    define STIN static inline
-#  elif _WIN32
+#  elif defined(_WIN32)
 #    define STIN static __inline__
 #  endif
 #else
diff --git a/apps/plugins/doom/d_main.c b/apps/plugins/doom/d_main.c
index 32e3809..f58d1aa 100644
--- a/apps/plugins/doom/d_main.c
+++ b/apps/plugins/doom/d_main.c
@@ -194,7 +194,7 @@ void D_Display (void)

    if (gamestate != GS_LEVEL) { // Not a level
       switch (oldgamestate) {
-      case -1:
+      case (gamestate_t)-1:
       case GS_LEVEL:
          V_SetPalette(0); // cph - use default (basic) palette
       default:
diff --git a/apps/plugins/doom/g_game.c b/apps/plugins/doom/g_game.c
index e8c55eb..d444525 100644
--- a/apps/plugins/doom/g_game.c
+++ b/apps/plugins/doom/g_game.c
@@ -2012,7 +2012,7 @@ void G_ReloadDefaults(void)
       int i = M_CheckParm("-complevel");
       if (i && (1+i) < myargc) compatibility_level = atoi(myargv[i+1]);
    }
-   if ((signed)compatibility_level == -1)
+   if (compatibility_level == (complevel_t)-1)
       compatibility_level = MAX_COMPATIBILITY_LEVEL-1;

    if (mbf_features)
diff --git a/apps/plugins/doom/p_enemy.c b/apps/plugins/doom/p_enemy.c
index b1f40bc..5b3f958 100644
--- a/apps/plugins/doom/p_enemy.c
+++ b/apps/plugins/doom/p_enemy.c
@@ -547,7 +547,7 @@ static void P_DoNewChaseDir(mobj_t *actor, fixed_t deltax, fixed_t deltay)
             return;
    }
    else
-      for (tdir = DI_SOUTHEAST; tdir != (unsigned)(DI_EAST-1); tdir--)
+      for (tdir = DI_SOUTHEAST; tdir != (dirtype_t)(DI_EAST-1); tdir--)
          if (tdir != turnaround && (actor->movedir = tdir, P_TryWalk(actor)))
             return;

diff --git a/apps/plugins/mpegplayer/alloc.c b/apps/plugins/mpegplayer/alloc.c
index da92f87..aa842af 100644
--- a/apps/plugins/mpegplayer/alloc.c
+++ b/apps/plugins/mpegplayer/alloc.c
@@ -112,13 +112,13 @@ static void * mpeg_malloc_internal (unsigned char *mallocbuf,
     (void)reason;
 }

-void *mpeg_malloc(size_t size, mpeg2_alloc_t reason)
+void *mpeg_malloc(size_t size, int reason)
 {
     return mpeg_malloc_internal(mallocbuf, &mem_ptr, bufsize, size,
                                 reason);
 }

-void *mpeg_malloc_all(size_t *size_out, mpeg2_alloc_t reason)
+void *mpeg_malloc_all(size_t *size_out, int reason)
 {
     /* Can steal all but MIN_MEMMARGIN */
     if (bufsize - mem_ptr < MIN_MEMMARGIN)
@@ -154,7 +154,7 @@ bool mpeg_alloc_init(unsigned char *buf, size_t mallocsize)
 }

 /* allocate non-dedicated buffer space which mpeg2_mem_reset will free */
-void * mpeg2_malloc(unsigned size, mpeg2_alloc_t reason)
+void * mpeg2_malloc(unsigned size, int reason)
 {
     void *ptr = mpeg_malloc_internal(mpeg2_mallocbuf, &mpeg2_mem_ptr,
                                      mpeg2_bufsize, size, reason);
@@ -167,7 +167,7 @@ void * mpeg2_malloc(unsigned size, mpeg2_alloc_t reason)

 /* allocate dedicated buffer - memory behind buffer pointer becomes dedicated
    so order is important */
-void * mpeg2_bufalloc(unsigned size, mpeg2_alloc_t reason)
+void * mpeg2_bufalloc(unsigned size, int reason)
 {
     void *buf = mpeg2_malloc(size, reason);

diff --git a/apps/plugins/mpegplayer/mpeg2.h b/apps/plugins/mpegplayer/mpeg2.h
index 2a63f39..0909ae2 100644
--- a/apps/plugins/mpegplayer/mpeg2.h
+++ b/apps/plugins/mpegplayer/mpeg2.h
@@ -130,6 +130,7 @@ typedef struct mpeg2_decoder_s mpeg2_decoder_t;

 typedef enum
 {
+    STATE_NEG               = -1,
     STATE_BUFFER            = 0,
     STATE_SEQUENCE          = 1,
     STATE_SEQUENCE_REPEATED = 2,
@@ -199,15 +200,16 @@ typedef enum
     MPEG2_ALLOC_CHUNK      = 1,
     MPEG2_ALLOC_YUV        = 2,
     MPEG2_ALLOC_CONVERT_ID = 3,
-    MPEG2_ALLOC_CONVERTED  = 4
+    MPEG2_ALLOC_CONVERTED  = 4,
+    MPEG2_ALLOC_T_MAX
 } mpeg2_alloc_t;

-void * mpeg2_malloc (unsigned size, mpeg2_alloc_t reason);
+void * mpeg2_malloc (unsigned size, int reason);
 #if 0
 void mpeg2_free (void * buf);
 #endif
 /* allocates a dedicated buffer and locks all previous allocation in place */
-void * mpeg2_bufalloc(unsigned size, mpeg2_alloc_t reason);
+void * mpeg2_bufalloc(unsigned size, int reason);
 /* clears all non-dedicated buffer space */
 void mpeg2_mem_reset(void);
 void mpeg2_alloc_init(unsigned char* buf, int mallocsize);
diff --git a/apps/plugins/mpegplayer/mpeg_alloc.h b/apps/plugins/mpegplayer/mpeg_alloc.h
index 9acfbc5..9a23721 100644
--- a/apps/plugins/mpegplayer/mpeg_alloc.h
+++ b/apps/plugins/mpegplayer/mpeg_alloc.h
@@ -23,9 +23,9 @@

 /* returns the remaining mpeg2 buffer and it's size */
 void * mpeg2_get_buf(size_t *size);
-void *mpeg_malloc(size_t size, mpeg2_alloc_t reason);
+void *mpeg_malloc(size_t size, int reason);
 /* Grabs all the buffer available sans margin */
-void *mpeg_malloc_all(size_t *size_out, mpeg2_alloc_t reason);
+void *mpeg_malloc_all(size_t *size_out, int reason);
 /* Initializes the malloc buffer with the given base buffer */
 bool mpeg_alloc_init(unsigned char *buf, size_t mallocsize);

diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h
index 6247a6d..7b11730 100644
--- a/apps/plugins/mpegplayer/mpegplayer.h
+++ b/apps/plugins/mpegplayer/mpegplayer.h
@@ -32,17 +32,6 @@
 /* Memory allotments for various subsystems */
 #define MIN_MEMMARGIN (4*1024)

-enum mpeg_malloc_reason_t
-{
-    __MPEG_ALLOC_FIRST = -256,
-    MPEG_ALLOC_CODEC_MALLOC,
-    MPEG_ALLOC_CODEC_CALLOC,
-    MPEG_ALLOC_MPEG2_BUFFER,
-    MPEG_ALLOC_AUDIOBUF,
-    MPEG_ALLOC_PCMOUT,
-    MPEG_ALLOC_DISKBUF,
-};
-
 /** Video thread **/
 #define LIBMPEG2_ALLOC_SIZE (2*1024*1024)

@@ -103,6 +92,17 @@ enum mpeg_malloc_reason_t
 #include "disk_buf.h"
 #include "stream_mgr.h"

+enum mpeg_malloc_reason_t
+{
+    __MPEG_ALLOC_FIRST = -256,
+    MPEG_ALLOC_CODEC_MALLOC = MPEG2_ALLOC_T_MAX,
+    MPEG_ALLOC_CODEC_CALLOC,
+    MPEG_ALLOC_MPEG2_BUFFER,
+    MPEG_ALLOC_AUDIOBUF,
+    MPEG_ALLOC_PCMOUT,
+    MPEG_ALLOC_DISKBUF,
+};
+
 #define LCD_ENABLE_EVENT_0 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0)
 #define LCD_ENABLE_EVENT_1 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 1)

diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 6b608fc..de05d58 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -231,10 +231,14 @@ SECTIONS
         . = ALIGN(CACHEALIGN_SIZE);
         *(.ncdata*)
         . = ALIGN(CACHEALIGN_SIZE);
+#if defined(IRAMSIZE)
+        iramcopy = . - NOCACHE_BASE;
+#endif
+
     } AT> PLUGIN_RAM
 #endif

-#if defined(IRAMSIZE)
+#if defined(IRAMSIZE) && !NOCACHE_BASE
     iramcopy = . - NOCACHE_BASE;
 #endif

diff --git a/firmware/thread.c b/firmware/thread.c
index a63641e..ceda098 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -927,7 +927,7 @@ static inline void core_sleep(void)
         : : "z"(&SBYCR-GBR) : "r1");
 }

-#elif CPU_MIPS == 32
+#elif defined(CPU_MIPS) && CPU_MIPS == 32

 /*---------------------------------------------------------------------------
  * Start the thread running and terminate it if it returns
diff --git a/tools/configure b/tools/configure
index dc21789..2bce600 100755
--- a/tools/configure
+++ b/tools/configure
@@ -241,76 +241,67 @@ coldfirecc () {
 }

 arm7tdmicc () {
- prefixtools arm-elf-
+ prefixtools arm-elf-eabi-
  GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
- if test "X$1" != "Xshort"; then
-   GCCOPTS="$GCCOPTS -mlong-calls"
- fi
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 arm9tdmicc () {
- prefixtools arm-elf-
+ prefixtools arm-elf-eabi-
  GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
- if test "$modelname" != "gigabeatf" -a "$t_manufacturer" != "as3525"; then
-  GCCOPTS="$GCCOPTS -mlong-calls"
- fi
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 arm940tbecc () {
- prefixtools arm-elf-
- GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t -mlong-calls"
+ prefixtools arm-elf-eabi-
+ GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t"
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="big"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 arm940tcc () {
- prefixtools arm-elf-
- GCCOPTS="$CCOPTS -mcpu=arm940t -mlong-calls"
+ prefixtools arm-elf-eabi-
+ GCCOPTS="$CCOPTS -mcpu=arm940t"
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 arm946cc () {
- prefixtools arm-elf-
- GCCOPTS="$CCOPTS -mcpu=arm9e -mlong-calls"
+ prefixtools arm-elf-eabi-
+ GCCOPTS="$CCOPTS -mcpu=arm9e"
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 arm926ejscc () {
- prefixtools arm-elf-
- GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
+ prefixtools arm-elf-eabi-
+ GCCOPTS="$CCOPTS -mcpu=arm926ej-s"
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 arm1136jfscc () {
- prefixtools arm-elf-
+ prefixtools arm-elf-eabi-
  GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
- if test "$modelname" != "gigabeats"; then
-  GCCOPTS="$GCCOPTS -mlong-calls"
- fi
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 arm1176jzscc () {
- prefixtools arm-elf-
- GCCOPTS="$CCOPTS -mcpu=arm1176jz-s -mlong-calls"
+ prefixtools arm-elf-eabi-
+ GCCOPTS="$CCOPTS -mcpu=arm1176jz-s"
  GCCOPTIMIZE="-fomit-frame-pointer"
  endian="little"
- gccchoice="4.0.3"
+ gccchoice="4.4.1"
 }

 mipselcc () {
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh
index 3257d52..ed07167 100755
--- a/tools/rockboxdev.sh
+++ b/tools/rockboxdev.sh
@@ -182,8 +182,11 @@ case $arch in
     esac
     ;;
   [Aa])
-    target="arm-elf"
-    gccpatch="rockbox-multilibs-arm-elf-gcc-4.0.3_3.diff"
+    target="arm-elf-eabi"
+    gccpatch="rockbox-multilibs-arm-elf-gcc-4.4.1_1.diff"
+    gccconfigure="--disable-libssp --disable-libmudflap --disable-libunwind-exceptions"
+    binutils="2.20.51"
+    gccver="4.4.1"
     ;;
   [Ii])
     target="mipsel-elf"
@@ -226,7 +229,12 @@ echo ""
 if test -f "$dlwhere/binutils-$binutils.tar.bz2"; then
   echo "binutils $binutils already downloaded"
 else
-  getfile binutils-$binutils.tar.bz2 $GNU_MIRROR/binutils
+  #check for snapshot release
+  if [ "${binutils##*.*.}" -gt 49 ] ; then
+    getfile binutils-$binutils.tar.bz2 'ftp://sourceware.org/pub/binutils/snapshots'
+  else
+    getfile binutils-$binutils.tar.bz2 $GNU_MIRROR/binutils
+  fi
 fi

 if test -f "$dlwhere/gcc-core-$gccver.tar.bz2"; then