Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 17 commits
  • 38 files changed
  • 0 commit comments
  • 5 contributors
Commits on Jan 20, 2012
Marek Salaba FS#12553 - Second January update of Czech language
Signed-off-by: Bertrik Sikken <bertrik@sikken.nl>

Change-Id: I915d3158ab21a0ab130560137c739b9541b09e36
05bba5e
Michael Sevakis Neaten up pcmbuf a bit with regards to differences determined by MEMO…
…RYSIZE.

Change-Id: Ie7ba930e3331fd48186c245bd8a30731017d688e
c7f3a0b
Commits on Jan 21, 2012
@dreamlayers dreamlayers Fix FS#12555: Use smoothed battery voltage for level and runtime calc…
…ulation

The debug screen gets un-smoothed battery status via battery_read_info().
The level and runtime that is normally presented to the user needs to be
based on smoothed voltage.

Change-Id: Icb448853973aa1d5832e9094176938cfa12b2e48
109084d
@kugel- hosted/pcm/alsa: Use alternate signal stack for the async callback.
Signals are by default executed on the user stack, i.e. the stack of
the currently active thread. This has two problems:
1) The stack size of the current stack is likely insufficient (unless
using sigaltstack threads) because our stack sizes are normally
below MINSIGSTKSIZE which is needed to deliver a signal.
2) Some of our asm code does nasty tricks with the stack pointer. When a
signal comes in during this bad things can happen, e.g. random memory
being overwritten or simply a crash.

Using a well defined stack fixes this. This is comparable with the
separate irq stack on native targets.
34b0311
@kugel- libmad: Fix section attrs for hosted platforms. cdb2878
@kugel- libmad: Get rid of some bad trickery with the stack pointer.
Using the stack pointer for anything else than pointing to the
current stack can have in very bad effects, especially on hosted
platforms (e.g. when mixed with signals). Remove this at
very slight performance cost.
4343011
@kugel- Move supprt-arm.S to separate library.
Core, codecs and plugins link it separately so this gets rid of SOURCES trickery.
Don't build it for hosted targets.

Change-Id: If15ef90e93cd218a4352ae8e89eea95d3122452f
cf333a6
@kugel- Hosted: Merge debugf() implementations. Cleanup debug.h.
Fixes debug build for ypr0.

Change-Id: I9c0eff651dcf268a3fafed1a71fcc47f3e323d36
5b4a6c4
@kugel- ypr0: Fix build failure.
Change-Id: I327d58fde66fc7fa65f91e0ca724c3fd8066ccf6
856bb42
@kugel- Hosted: Output map files after linking.
Change-Id: I5ac64d781aaa1aa2b3157589f8e689c0d946a39f
6d19275
@kugel- libspeex: Get rid of some bad trickery with the stack pointer.
Using the stack pointer for anything else than pointing to the
current stack can have in very bad effects, especially on hosted
platforms (e.g. when mixed with signals). Remove this at a
neglible performance cost.

Change-Id: I9545d701bd13c32456c224b87c708d907880c0ff
a0d54b0
@kugel- android/ypr0: Merge kernel-*.c to generic kernel-unix.c.
Change-Id: Ife3fceb53829ef4e13bae73d8d2f10d7e56d484d
954cd77
@kugel- android/ypr0: Merge fs-*.c to generic filesystem-unix.c.
Change-Id: I52e2c29346baf0d282243880477cd149311ce3d1
5d13ecc
@kugel- android/ypr0: Merge lc-*.c to generic lc-unix.c.
Change-Id: Ica76dec903486c32fda8355acdc58f0315c4d384
d3ae11d
@kugel- Add some stuff to .gitignore
Change-Id: Ib91a5da0ca1ed76399cd24cac9d9e492d5392d6e
490c87c
@kugel- Fix database build.
Change-Id: I3e057a680057bdda859af5deefbda0e65211b284
6b7db7e
@pamaury pamaury imx233: fix clkctrl code (some registers don't have a SET/CLR variant)
Change-Id: I3ce6a77cdc5ea89e1e43bc00c9ec43664e765fdc
eaa83bd
Showing with 436 additions and 609 deletions.
  1. +30 −0 .gitignore
  2. +1 −1 android/android.make
  3. +2 −2 apps/codecs/codecs.make
  4. +0 −4 apps/codecs/lib/SOURCES
  5. +8 −0 apps/codecs/libmad/mad_iram.h
  6. +141 −147 apps/codecs/libmad/synth_full_arm.S
  7. +7 −8 apps/codecs/libspeex/filters_arm4.S
  8. +2 −2 apps/lang/czech.lang
  9. +19 −24 apps/pcmbuf.c
  10. +2 −2 apps/plugins/imageviewer/imageviewer.make
  11. +0 −1 apps/plugins/lib/SOURCES
  12. +3 −3 apps/plugins/plugins.make
  13. +15 −8 firmware/SOURCES
  14. +5 −9 firmware/common/rbpaths.c
  15. +7 −16 firmware/export/debug.h
  16. +5 −2 firmware/powermgmt.c
  17. +9 −8 firmware/target/arm/imx233/clkctrl-imx233.c
  18. +5 −0 firmware/target/arm/imx233/clkctrl-imx233.h
  19. +1 −8 firmware/target/hosted/android/dir-target.h
  20. +0 −141 firmware/target/hosted/android/fs-android.c
  21. +0 −117 firmware/target/hosted/android/kernel-android.c
  22. +2 −9 firmware/target/hosted/android/system-target.h
  23. +65 −0 firmware/target/hosted/debug-hosted.c
  24. 0 firmware/target/hosted/{ypr0/fs-ypr0.c → filesystem-unix.c}
  25. +13 −8 firmware/target/hosted/{ypr0/kernel-ypr0.c → kernel-unix.c}
  26. +16 −22 firmware/target/hosted/{android/lc-android.c → kernel-unix.h}
  27. +4 −1 firmware/target/hosted/{ypr0/lc-ypr0.c → lc-unix.c}
  28. +31 −0 firmware/target/hosted/pcm-alsa.c
  29. +1 −2 firmware/target/hosted/ypr0/ascodec-ypr0.c
  30. +1 −8 firmware/target/hosted/ypr0/dir-target.h
  31. +1 −1 firmware/target/hosted/ypr0/powermgmt-ypr0.c
  32. +1 −7 firmware/target/hosted/ypr0/system-target.h
  33. +17 −0 lib/arm_support/arm_support.make
  34. 0 {firmware/target/arm → lib/arm_support}/support-arm.S
  35. +1 −0 tools/database/SOURCES
  36. +19 −7 tools/root.make
  37. +0 −40 uisimulator/common/io.c
  38. +2 −1 uisimulator/uisimulator.make
View
30 .gitignore
@@ -1,8 +1,38 @@
# /
/build*
+/sim*
/output
+*.elf
*.exe
+# android: java build system
+/android/bin
+/android/data
+/android/gen
+/android/libs
+/android/local.properties
+
+# android: our build system
+/android/autoconf.h
+/android/Makefile
+/android/make.dep
+/android/apps
+/android/bitmaps
+/android/pluginbitmaps
+/android/firmware
+/android/lang
+/android/lib
+/android/librockbox.so
+/android/rockbox.*
+/android/rockbox-info.txt
+/android/sysfont.c
+/android/sysfont.h
+/android/version.h
+/android/credits.raw
+
+# android: eclipse stuff
+/android/.settings
+
# /rbutil/
/rbutil/Makefile
/rbutil/rbutil
View
2 android/android.make
@@ -115,7 +115,7 @@ classes: $(R_OBJ) $(JAVA_OBJ)
$(BUILDDIR)/$(BINARY): $$(OBJ) $(VOICESPEEXLIB) $(FIRMLIB) $(SKINLIB) $(CPUFEAT_BUILD)/cpu-features.o
- $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(LDOPTS) $(GLOBAL_LDOPTS)
+ $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(LDOPTS) $(GLOBAL_LDOPTS) -Wl,-Map,$(BUILDDIR)/rockbox.map
$(call PRINTS,OC $(@F))$(OC) -S -x $@
$(BINLIB_DIR)/$(BINARY): $(BUILDDIR)/$(BINARY)
View
4 apps/codecs/codecs.make
@@ -186,7 +186,7 @@ $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S
-I$(dir $<) $(CODECFLAGS) $(ASMFLAGS) -c $< -o $@
ifdef APP_TYPE
- CODECLDFLAGS = $(SHARED_LDFLAG) # <-- from Makefile
+ CODECLDFLAGS = $(SHARED_LDFLAG) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
CODECFLAGS += $(SHARED_CFLAGS) # <-- from Makefile
else
CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
@@ -201,7 +201,7 @@ $(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECLIB
$(CODECLIB) \
-lgcc $(subst .map,-pre.map,$(CODECLDFLAGS))
-$(CODECDIR)/%.codec: $(CODECDIR)/%.o $(LIBSETJMP)
+$(CODECDIR)/%.codec: $(CODECDIR)/%.o $(LIBSETJMP) $(LIBARMSUPPORT)
$(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \
$(filter %.o, $^) \
$(filter %.a, $+) \
View
4 apps/codecs/lib/SOURCES
@@ -7,10 +7,6 @@ mdct_lookup.c
fft-ffmpeg.c
mdct.c
-#ifdef CPU_ARM
-../../../firmware/target/arm/support-arm.S
-#endif
-
#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
osx.dummy.c
#endif
View
8 apps/codecs/libmad/mad_iram.h
@@ -29,6 +29,12 @@
#include "config.h"
+#if (CONFIG_PLATFORM&PLATFORM_HOSTED)
+#define ICODE_SECTION_MPA_ARM .text
+#define IBSS_SECTION_MPA_ARM .bss
+#define ICODE_ATTR_MPA_SYNTH
+#define ICONST_ATTR_MPA_HUFFMAN
+#else
/* Code performs slower in IRAM on PP502x and there is no space in
mpegplayer on the PP5002. S3C2440 doesn't have any IRAM available for
codecs */
@@ -46,4 +52,6 @@
#define ICONST_ATTR_MPA_HUFFMAN ICONST_ATTR
#endif
+#endif
+
#endif /* MAD_IRAM_H */
View
288 apps/codecs/libmad/synth_full_arm.S
@@ -27,107 +27,109 @@
.global synth_full_odd_sbsample
.global synth_full_even_sbsample
- ;; r0 = pcm
+ /*
+ ;; r0 = pcm (pushed on the stack to free a register)
;; r1 = fo
;; r2 = fe
;; r3 = D0ptr
;; r4 = D1ptr
- /*;; r5 = loop counter
+ ;; r5 = loop counter
;; r6,r7 accumulator1
- ;; r8,r9 accumulator2 */
+ ;; r8,r9 accumulator2
+ */
synth_full_odd_sbsample:
- stmdb sp!, {r4-r11, lr}
- ldr r4, [sp, #36]
- ldr r5, =synth_full_sp
- str sp, [r5]
+ stmdb sp!, {r0, r4-r11, lr}
+ ldr r4, [sp, #40]
mov r5, #15
add r2, r2, #32
.l:
/* ;; PROD_O and odd half of SB_SAMPLE*/
add r3, r3, #128
add r4, r4, #128
ldr r7, [r3, #4]
- ldmia r1!, {r10, r11, r12, lr}
+ ldmia r1!, {r0, r10, r11, lr}
ldr r9, [r4, #120]
- smull r6, r7, r10, r7
- ldr sp, [r3, #60]
- smull r8, r9, r10, r9
- ldr r10, [r3, #52]
- smlal r6, r7, r11, sp
- ldr sp, [r3, #44]
- smlal r6, r7, r12, r10
- ldr r10, [r4, #64]
- smlal r6, r7, lr, sp
- ldr sp, [r4, #72]
- smlal r8, r9, r11, r10
- ldr r10, [r4, #80]
- smlal r8, r9, r12, sp
- smlal r8, r9, lr, r10
- ldr r10, [r3, #36]
+ smull r6, r7, r0, r7
+ ldr r12, [r3, #60]
+ smull r8, r9, r0, r9
+ ldr r0, [r3, #52]
+ smlal r6, r7, r10, r12
+ ldr r12, [r3, #44]
+ smlal r6, r7, r11, r0
+ ldr r0, [r4, #64]
+ smlal r6, r7, lr, r12
+ ldr r12, [r4, #72]
+ smlal r8, r9, r10, r0
+ ldr r0, [r4, #80]
+ smlal r8, r9, r11, r12
+ smlal r8, r9, lr, r0
+ ldr r0, [r3, #36]
- ldmia r1!, {r11, r12, sp, lr}
- smlal r6, r7, r11, r10
+ ldmia r1!, {r10, r11, r12, lr}
+ smlal r6, r7, r10, r0
- ldr r10, [r4, #88] /*;;1 cycle stall on arm9, but we free up r11*/
- smlal r8, r9, r11, r10
+ ldr r0, [r4, #88] /*;;1 cycle stall on arm9, but we free up r10*/
+ smlal r8, r9, r10, r0
- ldr r10, [r3, #28]
- ldr r11, [r3, #20]
+ ldr r0, [r3, #28]
+ ldr r10, [r3, #20]
+ smlal r6, r7, r11, r0
+ ldr r0, [r3, #12]
smlal r6, r7, r12, r10
- ldr r10, [r3, #12]
- smlal r6, r7, sp, r11
- ldr r11, [r4, #96]
- smlal r6, r7, lr, r10
- ldr r10, [r4, #104]
- smlal r8, r9, r12, r11
- ldr r11, [r4, #112]
- smlal r8, r9, sp, r10
- smlal r8, r9, lr, r11
+ ldr r10, [r4, #96]
+ smlal r6, r7, lr, r0
+ ldr r0, [r4, #104]
+ smlal r8, r9, r11, r10
+ ldr r10, [r4, #112]
+ smlal r8, r9, r12, r0
+ smlal r8, r9, lr, r10
rsbs r6, r6, #0
rsc r7, r7, #0
/* ;; PROD_A and even half of SB_SAMPLE*/
- ldr r10, [r3, #0]
- ldmia r2!, {r11, r12, sp, lr}
- smlal r6, r7, r11, r10
+ ldr r0, [r3, #0]
+ ldmia r2!, {r10, r11, r12, lr}
+ smlal r6, r7, r10, r0
- ldr r10, [r4, #60] /*;;1 cycle stall on arm9, but we free up r11*/
- smlal r8, r9, r11, r10
- ldr r11, [r3, #56]
- ldr r10, [r3, #48]
- smlal r6, r7, r12, r11
- ldr r11, [r3, #40]
- smlal r6, r7, sp, r10
- ldr r10, [r4, #68]
- smlal r6, r7, lr, r11
- ldr r11, [r4, #76]
+ ldr r0, [r4, #60] /*;;1 cycle stall on arm9, but we free up r10*/
+ smlal r8, r9, r10, r0
+ ldr r10, [r3, #56]
+ ldr r0, [r3, #48]
+ smlal r6, r7, r11, r10
+ ldr r10, [r3, #40]
+ smlal r6, r7, r12, r0
+ ldr r0, [r4, #68]
+ smlal r6, r7, lr, r10
+ ldr r10, [r4, #76]
+ smlal r8, r9, r11, r0
+ ldr r0, [r4, #84]
smlal r8, r9, r12, r10
- ldr r10, [r4, #84]
- smlal r8, r9, sp, r11
- smlal r8, r9, lr, r10
+ smlal r8, r9, lr, r0
- ldr r10, [r3, #32]
- ldmia r2!, {r11, r12, sp, lr}
- smlal r6, r7, r11, r10
+ ldr r0, [r3, #32]
+ ldmia r2!, {r10, r11, r12, lr}
+ smlal r6, r7, r10, r0
- ldr r10, [r4, #92] /*;;1 cycle stall on arm9, but we free up r11*/
- smlal r8, r9, r11, r10
+ ldr r0, [r4, #92] /*;;1 cycle stall on arm9, but we free up r10*/
+ smlal r8, r9, r10, r0
- ldr r10, [r3, #24]
- ldr r11, [r3, #16]
+ ldr r0, [r3, #24]
+ ldr r10, [r3, #16]
+ smlal r6, r7, r11, r0
+ ldr r0, [r3, #8]
smlal r6, r7, r12, r10
- ldr r10, [r3, #8]
- smlal r6, r7, sp, r11
- ldr r11, [r4, #100]
- smlal r6, r7, lr, r10
- ldr r10, [r4, #108]
- smlal r8, r9, r12, r11
- ldr r11, [r4, #116]
- smlal r8, r9, sp, r10
- smlal r8, r9, lr, r11
+ ldr r10, [r4, #100]
+ smlal r6, r7, lr, r0
+ ldr r0, [r4, #108]
+ smlal r8, r9, r11, r10
+ ldr r10, [r4, #116]
+ smlal r8, r9, r12, r0
+ smlal r8, r9, lr, r10
+
+ ldr r0, [sp]
movs r6, r6, lsr #16
adc r6, r6, r7, lsl #16
@@ -140,100 +142,98 @@ synth_full_odd_sbsample:
subs r5, r5, #1
bne .l
- ldr r5, =synth_full_sp
- ldr sp, [r5]
- ldmpc regs=r4-r11
+ ldmpc regs="r0,r4-r11"
synth_full_even_sbsample:
- stmdb sp!, {r4-r11, lr}
- ldr r4, [sp, #36]
- ldr r5, =synth_full_sp
- str sp, [r5]
+ stmdb sp!, {r0, r4-r11, lr}
+ ldr r4, [sp, #40]
mov r5, #15
add r2, r2, #32
.l2:
/* ;; PROD_O and odd half of SB_SAMPLE*/
add r3, r3, #128
add r4, r4, #128
ldr r7, [r3, #0]
- ldmia r1!, {r10, r11, r12, lr}
+ ldmia r1!, {r0, r10, r11, lr}
ldr r9, [r4, #60]
- smull r6, r7, r10, r7
- ldr sp, [r3, #56]
- smull r8, r9, r10, r9
- ldr r10, [r3, #48]
- smlal r6, r7, r11, sp
- ldr sp, [r3, #40]
- smlal r6, r7, r12, r10
- ldr r10, [r4, #68]
- smlal r6, r7, lr, sp
+ smull r6, r7, r0, r7
+ ldr r12, [r3, #56]
+ smull r8, r9, r0, r9
+ ldr r0, [r3, #48]
+ smlal r6, r7, r10, r12
+ ldr r12, [r3, #40]
+ smlal r6, r7, r11, r0
+ ldr r0, [r4, #68]
+ smlal r6, r7, lr, r12
- ldr sp, [r4, #76]
- smlal r8, r9, r11, r10
- ldr r10, [r4, #84]
- smlal r8, r9, r12, sp
- smlal r8, r9, lr, r10
+ ldr r12, [r4, #76]
+ smlal r8, r9, r10, r0
+ ldr r0, [r4, #84]
+ smlal r8, r9, r11, r12
+ smlal r8, r9, lr, r0
- ldr r10, [r3, #32]
- ldmia r1!, {r11, r12, sp, lr}
+ ldr r0, [r3, #32]
+ ldmia r1!, {r10, r11, r12, lr}
- smlal r6, r7, r11, r10
- ldr r10, [r4, #92]
- smlal r8, r9, r11, r10
- ldr r10, [r3, #24]
- ldr r11, [r3, #16]
+ smlal r6, r7, r10, r0
+ ldr r0, [r4, #92]
+ smlal r8, r9, r10, r0
+ ldr r0, [r3, #24]
+ ldr r10, [r3, #16]
+ smlal r6, r7, r11, r0
+ ldr r0, [r3, #8]
smlal r6, r7, r12, r10
- ldr r10, [r3, #8]
- smlal r6, r7, sp, r11
- ldr r11, [r4, #100]
- smlal r6, r7, lr, r10
- ldr r10, [r4, #108]
- smlal r8, r9, r12, r11
- ldr r11, [r4, #116]
- smlal r8, r9, sp, r10
- smlal r8, r9, lr, r11
+ ldr r10, [r4, #100]
+ smlal r6, r7, lr, r0
+ ldr r0, [r4, #108]
+ smlal r8, r9, r11, r10
+ ldr r10, [r4, #116]
+ smlal r8, r9, r12, r0
+ smlal r8, r9, lr, r10
rsbs r6, r6, #0
rsc r7, r7, #0
- ldr r10, [r3, #4]
- ldmia r2!, {r11, r12, sp, lr}
- smlal r6, r7, r11, r10
- ldr r10, [r4, #120] /*;;1 cycle stall on arm9, but we free up r11*/
- smlal r8, r9, r11, r10
- ldr r10, [r3, #60]
- ldr r11, [r3, #52]
+ ldr r0, [r3, #4]
+ ldmia r2!, {r10, r11, r12, lr}
+ smlal r6, r7, r10, r0
+ ldr r0, [r4, #120] /*;;1 cycle stall on arm9, but we free up r10*/
+ smlal r8, r9, r10, r0
+ ldr r0, [r3, #60]
+ ldr r10, [r3, #52]
+ smlal r6, r7, r11, r0
+ ldr r0, [r3, #44]
smlal r6, r7, r12, r10
- ldr r10, [r3, #44]
- smlal r6, r7, sp, r11
- ldr r11, [r4, #64]
- smlal r6, r7, lr, r10
+ ldr r10, [r4, #64]
+ smlal r6, r7, lr, r0
- ldr r10, [r4, #72]
- smlal r8, r9, r12, r11
- ldr r11, [r4, #80]
- smlal r8, r9, sp, r10
+ ldr r0, [r4, #72]
+ smlal r8, r9, r11, r10
+ ldr r10, [r4, #80]
+ smlal r8, r9, r12, r0
- smlal r8, r9, lr, r11
+ smlal r8, r9, lr, r10
- ldr r10, [r3, #36]
- ldmia r2!, {r11, r12, sp, lr}
- smlal r6, r7, r11, r10
- ldr r10, [r4, #88] /*;;1 cycle stall on arm9, but we free up r11*/
- smlal r8, r9, r11, r10
+ ldr r0, [r3, #36]
+ ldmia r2!, {r10, r11, r12, lr}
+ smlal r6, r7, r10, r0
+ ldr r0, [r4, #88] /*;;1 cycle stall on arm9, but we free up r10*/
+ smlal r8, r9, r10, r0
- ldr r10, [r3, #28]
- ldr r11, [r3, #20]
+ ldr r0, [r3, #28]
+ ldr r10, [r3, #20]
+ smlal r6, r7, r11, r0
+ ldr r0, [r3, #12]
smlal r6, r7, r12, r10
- ldr r10, [r3, #12]
- smlal r6, r7, sp, r11
- ldr r11, [r4, #96]
- smlal r6, r7, lr, r10
- ldr r10, [r4, #104]
- smlal r8, r9, r12, r11
- ldr r11, [r4, #112]
- smlal r8, r9, sp, r10
- smlal r8, r9, lr, r11
+ ldr r10, [r4, #96]
+ smlal r6, r7, lr, r0
+ ldr r0, [r4, #104]
+ smlal r8, r9, r11, r10
+ ldr r10, [r4, #112]
+ smlal r8, r9, r12, r0
+ smlal r8, r9, lr, r10
+
+ ldr r0, [sp]
movs r6, r6, lsr #16
adc r6, r6, r7, lsl #16
@@ -246,9 +246,7 @@ synth_full_even_sbsample:
subs r5, r5, #1
bne .l2
- ldr r5, =synth_full_sp
- ldr sp, [r5]
- ldmpc regs=r4-r11
+ ldmpc regs="r0,r4-r11"
.global III_aliasreduce
@@ -340,7 +338,3 @@ III_overlap:
ldmia r0!, {r4, r5, r6, r7, r12, lr}
stmia r1!, {r4, r5, r6, r7, r12, lr}
ldmpc regs=r4-r7
-
- .section IBSS_SECTION_MPA_ARM,"aw",%nobits
-synth_full_sp:
- .space 4
View
15 apps/codecs/libspeex/filters_arm4.S
@@ -206,11 +206,9 @@ qmf_synth:
sub r0, r8, r5 @ r0 = &xx1[N2]
sub r1, r9, r5 @ r1 = &xx2[N2]
- str r4, [sp, #-4] @ Stack N
+ str r4, [sp, #-4]! @ Stack N
mov r4, r5
- str r4, [sp, #-8] @ Stack M
- @ sp doesn't point to the end of the stack frame from here on, but we're not
- @ calling anything so it shouldn't matter
+ str r4, [sp, #-4]! @ Stack M
@ Main loop, register usage:
@ r0 = xx1, r1 = xx2, r2 = a, r3 = y, r4 = M, r5 = x10, r6 = x11, r7 = x20
@ r8 = x21, r9 = [a1, a0], r10 = acc0, r11 = acc1, r12 = acc2, r14 = acc3
@@ -251,7 +249,7 @@ qmf_synth:
subs r4, r4, #4
bne 1b
- ldr r4, [sp, #-8] @ r4 = M
+ ldr r4, [sp] @ r4 = M
sub r2, r2, r4, lsl #1 @ r2 = &a[0]
sub r0, r0, r4 @ r0 = &xx1[N2 - 2 - i]
sub r1, r1, r4 @ r1 = &xx2[N2 - 2 - i]
@@ -281,13 +279,14 @@ qmf_synth:
strh r11, [r3], #2
strh r12, [r3], #2
strh r14, [r3], #2
- ldr r10, [sp, #-4] @ Load N
+ ldr r10, [sp, #4] @ Load N
subs r10, r10, #4 @ Are we done?
- strne r10, [sp, #-4]
- bne 0b
+ strne r10, [sp, #4] @ no ->
+ bne 0b @ do outer loop
@ Copy start of xx1 and xx2 back to alternate mem1 and mem2 entries
@ r0 and r1 are &xx1[0] and &xx2[0] at this point
+ add sp, sp, #8
ldmia sp, { r5-r6, sp } @ Fetch &mem1[1], &mem2[1], restore sp
0:
ldr r7, [r0], #4
View
4 apps/lang/czech.lang
@@ -10161,7 +10161,7 @@
</dest>
<voice>
*: none
- rtc: "celá"
+ rtc: "nula nula"
</voice>
</phrase>
<phrase>
@@ -12789,7 +12789,7 @@
*: "Zrušit časovač vypnutí"
</dest>
<voice>
- *: "Zrušit časovač vypnutí"
+ *: "Zrušit časovač vypnutí, zbývá"
</voice>
</phrase>
<phrase>
View
43 apps/pcmbuf.c
@@ -58,6 +58,9 @@
on commit */
#define CROSSFADE_BUFSIZE 8192u
+/* Return data level in 1/4-second increments */
+#define DATA_LEVEL(quarter_secs) (NATIVE_FREQUENCY * (quarter_secs))
+
/* Number of bytes played per second:
(sample rate * 2 channels * 2 bytes/sample) */
#define BYTERATE (NATIVE_FREQUENCY * 4)
@@ -66,9 +69,13 @@
/* Keep watermark high for large memory target - at least (2s) */
#define PCMBUF_WATERMARK (BYTERATE * 2)
#define MIN_BUFFER_SIZE (BYTERATE * 3)
+/* 1 seconds of buffer is low data */
+#define LOW_DATA DATA_LEVEL(4)
#else
#define PCMBUF_WATERMARK (BYTERATE / 4) /* 0.25 seconds */
#define MIN_BUFFER_SIZE (BYTERATE * 1)
+/* under watermark is low data */
+#define LOW_DATA pcmbuf_watermark
#endif
/* Describes each audio packet - keep it small since there are many of them */
@@ -95,10 +102,11 @@ static size_t chunk_ridx;
static size_t chunk_widx;
static size_t pcmbuf_bytes_waiting;
-
-static size_t pcmbuf_watermark;
static struct chunkdesc *current_desc;
+/* Only written if HAVE_CROSSFADE */
+static size_t pcmbuf_watermark = PCMBUF_WATERMARK;
+
static bool low_latency_mode = false;
static bool pcmbuf_sync_position = false;
@@ -160,10 +168,6 @@ static void pcmbuf_finish_crossfade_enable(void);
static int codec_thread_priority = PRIORITY_PLAYBACK;
#endif
-/* Helpful macros for use in conditionals this assumes some of the above
- * static variable names */
-#define DATA_LEVEL(quarter_secs) (NATIVE_FREQUENCY * (quarter_secs))
-
/* Callbacks into playback.c */
extern void audio_pcmbuf_position_callback(unsigned long elapsed,
off_t offset, unsigned int key);
@@ -187,6 +191,12 @@ static size_t pcmbuf_unplayed_bytes(void)
return widx - ridx;
}
+/* Returns TRUE if amount of data is under the target fill size */
+static bool pcmbuf_data_critical(void)
+{
+ return pcmbuf_unplayed_bytes() < LOW_DATA;
+}
+
/* Return the next PCM chunk in the PCM buffer given a byte index into it */
static size_t index_next(size_t index)
{
@@ -418,15 +428,8 @@ void * pcmbuf_request_buffer(int *count)
trigger_cpu_boost();
/* If pre-buffered to the watermark, start playback */
-#if MEMORYSIZE > 2
- if (remaining > DATA_LEVEL(4))
-#else
- if (remaining > pcmbuf_watermark)
-#endif
- {
- if (audio_pcmbuf_may_play())
- pcmbuf_play_start();
- }
+ if (!pcmbuf_data_critical() && audio_pcmbuf_may_play())
+ pcmbuf_play_start();
}
void *buf =
@@ -520,8 +523,6 @@ size_t pcmbuf_init(unsigned char *bufend)
}
pcmbuf_finish_crossfade_enable();
-#else /* !HAVE_CROSSFADE */
- pcmbuf_watermark = PCMBUF_WATERMARK;
#endif /* HAVE_CROSSFADE */
init_buffer_state();
@@ -1283,13 +1284,7 @@ bool pcmbuf_is_lowdata(void)
if (status != CHANNEL_PLAYING || pcmbuf_is_crossfade_active())
return false;
-#if MEMORYSIZE > 2
- /* 1 seconds of buffer is low data */
- return pcmbuf_unplayed_bytes() < DATA_LEVEL(4);
-#else
- /* under watermark is low data */
- return pcmbuf_unplayed_bytes() < pcmbuf_watermark;
-#endif
+ return pcmbuf_data_critical();
}
void pcmbuf_set_low_latency(bool state)
View
4 apps/plugins/imageviewer/imageviewer.make
@@ -32,7 +32,7 @@ ifndef APP_TYPE
IMGDEC_OUTLDS = $(IMGVBUILDDIR)/%.link
IMGDEC_OVLFLAGS = -T$(IMGVBUILDDIR)/$*.link -Wl,--gc-sections -Wl,-Map,$(IMGVBUILDDIR)/$*.map
else
- IMGDEC_OVLFLAGS = $(PLUGINLDFLAGS)
+ IMGDEC_OVLFLAGS = $(PLUGINLDFLAGS) -Wl,-Map,$(IMGVBUILDDIR)/$*.map
endif
$(IMGVBUILDDIR)/%.ovl: $(IMGDEC_OUTLDS)
@@ -47,7 +47,7 @@ else
endif
# rule to create reference map for image decoder
-$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB)
+$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(LIBARMSUPPORT) $(PLUGINBITMAPLIB)
$(call PRINTS,LD $(@F))$(CC) $(IMGDECFLAGS) -o /dev/null \
$(filter %.o, $^) \
$(filter %.a, $+) \
View
1 apps/plugins/lib/SOURCES
@@ -41,7 +41,6 @@ playergfx.c
#ifdef HAVE_LCD_BITMAP
#ifdef CPU_ARM
-../../../firmware/target/arm/support-arm.S
pluginlib_jpeg_idct_arm.S
#endif
View
6 apps/plugins/plugins.make
@@ -65,7 +65,7 @@ PLUGINFLAGS = -I$(APPSDIR)/plugins -DPLUGIN $(CFLAGS)
$(ROCKS1): $(BUILDDIR)/%.rock: $(BUILDDIR)/%.o
# dependency for all plugins
-$(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(PLUGIN_CRT0) $(LIBSETJMP)
+$(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(PLUGIN_CRT0) $(LIBSETJMP) $(LIBARMSUPPORT)
$(PLUGINLIB): $(PLUGINLIB_OBJ)
$(SILENT)$(shell rm -f $@)
@@ -105,7 +105,7 @@ $(BUILDDIR)/apps/plugins/%.o: $(ROOTDIR)/apps/plugins/%.c
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -c $< -o $@
ifdef APP_TYPE
- PLUGINLDFLAGS = $(SHARED_LDFLAG) # <-- from Makefile
+ PLUGINLDFLAGS = $(SHARED_LDFLAG) -Wl,-Map,$*.map
PLUGINFLAGS += $(SHARED_CFLAGS) # <-- from Makefile
else
PLUGINLDFLAGS = -T$(PLUGINLINK_LDS) -Wl,--gc-sections -Wl,-Map,$*.map
@@ -129,7 +129,7 @@ endif
$(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua
$(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/
-$(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(LIBSETJMP) $(PLUGIN_CRT0)
+$(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(LIBSETJMP) $(LIBARMSUPPORT) $(PLUGIN_CRT0)
$(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o /dev/null \
$(filter %.o, $^) \
$(filter %.a, $+) \
View
23 firmware/SOURCES
@@ -1,3 +1,6 @@
+#undef unix /* causes problems with some files */
+#undef linux
+
ata_idle_notify.c
events.c
backlight.c
@@ -9,13 +12,18 @@ powermgmt.c
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
#ifdef __linux__
-#undef linux
target/hosted/cpuinfo-linux.c
#endif
#ifndef SAMSUNG_YPR0 /* uses as3514 rtc */
target/hosted/rtc.c
#endif
+
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID) == 0 && \
+ (defined(DEBUG) || defined(SIMULATOR)) /* sim should define DEBUG instead */
+target/hosted/debug-hosted.c
+#endif
+
#endif
system.c
usb.c
@@ -70,12 +78,12 @@ drivers/rtc/rtc_as3514.c
#else
target/hosted/rtc.c
#endif
+target/hosted/kernel-unix.c
+target/hosted/filesystem-unix.c
+target/hosted/lc-unix.c
target/hosted/ypr0/button-ypr0.c
-target/hosted/ypr0/kernel-ypr0.c
target/hosted/ypr0/lcd-ypr0.c
target/hosted/ypr0/system-ypr0.c
-target/hosted/ypr0/fs-ypr0.c
-target/hosted/ypr0/lc-ypr0.c
thread.c
#ifdef HAVE_BACKLIGHT
target/hosted/ypr0/backlight-ypr0.c
@@ -454,7 +462,6 @@ target/coldfire/ata-as-coldfire.S
#elif defined(CPU_PP) || defined(CPU_ARM)
/* CPU_PP => CPU_ARM, CPU_ARM !=> CPU_PP */
-target/arm/support-arm.S
target/arm/memcpy-arm.S
target/arm/memmove-arm.S
@@ -1686,14 +1693,14 @@ target/arm/rk27xx/hm801/power-hm801.c
#endif
#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
-target/hosted/android/fs-android.c
+target/hosted/kernel-unix.c
+target/hosted/filesystem-unix.c
+target/hosted/lc-unix.c
target/hosted/android/lcd-android.c
-target/hosted/android/lc-android.c
target/hosted/android/button-android.c
#ifdef DEBUG
target/hosted/android/debug-android.c
#endif
-target/hosted/android/kernel-android.c
target/hosted/android/pcm-android.c
target/hosted/android/powermgmt-android.c
target/hosted/android/system-android.c
View
14 firmware/common/rbpaths.c
@@ -40,17 +40,13 @@
#undef rmdir
-#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID) || defined(SAMSUNG_YPR0)
#include "dir-target.h"
-#define opendir opendir_android
-#define mkdir mkdir_android
-#define rmdir rmdir_android
+#define opendir _opendir
+#define mkdir _mkdir
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
static const char rbhome[] = "/sdcard";
-#elif defined(SAMSUNG_YPR0)
-#include "dir-target.h"
-#define opendir opendir_ypr0
-#define mkdir mkdir_ypr0
-#define rmdir rmdir_ypr0
+#endif
#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
#define open sim_open
#define remove sim_remove
View
23 firmware/export/debug.h
@@ -29,36 +29,27 @@ extern void debugf(const char* fmt,...) ATTRIBUTE_PRINTF(1, 2);
extern void ldebugf(const char* file, int line, const char *fmt, ...)
ATTRIBUTE_PRINTF(3, 4);
-#ifndef CODEC
-#ifdef __GNUC__
+#ifndef CODEC
-/* */
#if defined(SIMULATOR) && !defined(__PCTOOL__) \
- || ((CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO|PLATFORM_PANDORA)) && defined(DEBUG))
+ || (defined(APPLICATION) && defined(DEBUG))
#define DEBUGF debugf
#define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__)
-#else
-#if defined(DEBUG)
+#elif defined(DEBUG) /* DEBUG on native targets */
#ifdef HAVE_GDB_API
void breakpoint(void);
#endif
#define DEBUGF debugf
#define LDEBUGF debugf
-#else
-#define DEBUGF(...) do { } while(0)
-#define LDEBUGF(...) do { } while(0)
-#endif
-#endif
+#else /* !DEBUG */
-#else
-
-#define DEBUGF debugf
-#define LDEBUGF debugf
+#define DEBUGF(...) do { } while(0)
+#define LDEBUGF(...) do { } while(0)
-#endif /* GCC */
+#endif /* SIMULATOR && !__PCTOOL__ || APPLICATION && DEBUG */
#endif /* CODEC */
#endif
View
7 firmware/powermgmt.c
@@ -281,8 +281,11 @@ static int voltage_to_battery_level(int battery_millivolts)
static void battery_status_update(void)
{
- int millivolt, level;
- battery_read_info(&millivolt, &level);
+ int millivolt = battery_voltage();
+ int level = _battery_level();
+
+ if (level < 0)
+ level = voltage_to_battery_level(millivolt);
#ifdef CURRENT_NORMAL /*don't try to estimate run or charge
time without normal current defined*/
View
17 firmware/target/arm/imx233/clkctrl-imx233.c
@@ -76,16 +76,17 @@ bool imx233_is_clock_enable(enum imx233_clock_t clk)
void imx233_set_clock_divisor(enum imx233_clock_t clk, int div)
{
+ /* warning: some registers like HW_CLKCTRL_PIX don't have a CLR/SET variant ! */
switch(clk)
{
case CLK_PIX:
- __REG_CLR(HW_CLKCTRL_PIX) = HW_CLKCTRL_PIX__DIV_BM;
- __REG_SET(HW_CLKCTRL_PIX) = div;
+ HW_CLKCTRL_PIX &= ~HW_CLKCTRL_PIX__DIV_BM;
+ HW_CLKCTRL_PIX |= div;
while(HW_CLKCTRL_PIX & __CLK_BUSY);
break;
case CLK_SSP:
- __REG_CLR(HW_CLKCTRL_SSP) = HW_CLKCTRL_SSP__DIV_BM;
- __REG_SET(HW_CLKCTRL_SSP) = div;
+ HW_CLKCTRL_SSP &= ~HW_CLKCTRL_SSP__DIV_BM;
+ HW_CLKCTRL_SSP |= div;
while(HW_CLKCTRL_SSP & __CLK_BUSY);
break;
case CLK_CPU:
@@ -94,8 +95,8 @@ void imx233_set_clock_divisor(enum imx233_clock_t clk, int div)
while(HW_CLKCTRL_CPU & HW_CLKCTRL_CPU__BUSY_REF_CPU);
break;
case CLK_EMI:
- __REG_CLR(HW_CLKCTRL_EMI) = HW_CLKCTRL_EMI__DIV_EMI_BM;
- __REG_SET(HW_CLKCTRL_EMI) = div;
+ HW_CLKCTRL_EMI &= ~HW_CLKCTRL_EMI__DIV_EMI_BM;
+ HW_CLKCTRL_EMI |= div;
while(HW_CLKCTRL_EMI & HW_CLKCTRL_EMI__BUSY_REF_EMI);
break;
case CLK_HBUS:
@@ -104,8 +105,8 @@ void imx233_set_clock_divisor(enum imx233_clock_t clk, int div)
while(HW_CLKCTRL_HBUS & __CLK_BUSY);
break;
case CLK_XBUS:
- __REG_CLR(HW_CLKCTRL_XBUS) = HW_CLKCTRL_XBUS__DIV_BM;
- __REG_SET(HW_CLKCTRL_XBUS) = div;
+ HW_CLKCTRL_XBUS &= ~HW_CLKCTRL_XBUS__DIV_BM;
+ HW_CLKCTRL_XBUS |= div;
while(HW_CLKCTRL_XBUS & __CLK_BUSY);
break;
default: return;
View
5 firmware/target/arm/imx233/clkctrl-imx233.h
@@ -52,6 +52,7 @@
#define HW_CLKCTRL_HBUS__SLOW_DIV_BM (0x7 << 16)
#define HW_CLKCTRL_HBUS__AUTO_SLOW_MODE (1 << 20)
+/* warning: this register doesn't have a CLR/SET variant ! */
#define HW_CLKCTRL_XBUS (*(volatile uint32_t *)(HW_CLKCTRL_BASE + 0x40))
#define HW_CLKCTRL_XBUS__DIV_BP 0
#define HW_CLKCTRL_XBUS__DIV_BM 0x3ff
@@ -62,14 +63,17 @@
#define HW_CLKCTRL_XTAL__DRI_CLK24M_GATE (1 << 28)
#define HW_CLKCTRL_XTAL__FILT_CLK24M_GATE (1 << 30)
+/* warning: this register doesn't have a CLR/SET variant ! */
#define HW_CLKCTRL_PIX (*(volatile uint32_t *)(HW_CLKCTRL_BASE + 0x60))
#define HW_CLKCTRL_PIX__DIV_BP 0
#define HW_CLKCTRL_PIX__DIV_BM 0xfff
+/* warning: this register doesn't have a CLR/SET variant ! */
#define HW_CLKCTRL_SSP (*(volatile uint32_t *)(HW_CLKCTRL_BASE + 0x70))
#define HW_CLKCTRL_SSP__DIV_BP 0
#define HW_CLKCTRL_SSP__DIV_BM 0x1ff
+/* warning: this register doesn't have a CLR/SET variant ! */
#define HW_CLKCTRL_EMI (*(volatile uint32_t *)(HW_CLKCTRL_BASE + 0xa0))
#define HW_CLKCTRL_EMI__DIV_EMI_BP 0
#define HW_CLKCTRL_EMI__DIV_EMI_BM 0x3f
@@ -94,6 +98,7 @@
#define HW_CLKCTRL_FRAC_XX__XX_STABLE (1 << 6)
#define HW_CLKCTRL_FRAC_XX__CLKGATEXX (1 << 7)
+/* warning: this register doesn't have a CLR/SET variant ! */
#define HW_CLKCTRL_RESET (*(volatile uint32_t *)(HW_CLKCTRL_BASE + 0x120))
#define HW_CLKCTRL_RESET_CHIP 0x2
#define HW_CLKCTRL_RESET_DIG 0x1
View
9 firmware/target/hosted/android/dir-target.h
@@ -32,16 +32,9 @@
#define mkdir_uncached _mkdir
#define rmdir_uncached rmdir
-#define dirent_android dirent
-#define DIR_android DIR
-#define opendir_android _opendir
-#define readdir_android _readdir
-#define closedir_android _closedir
-#define mkdir_android _mkdir
-#define rmdir_android rmdir
-
extern DIR* _opendir(const char* name);
extern int _mkdir(const char* name);
+extern int rmdir(const char* name);
extern int _closedir(DIR* dir);
extern struct dirent *_readdir(DIR* dir);
extern void fat_size(unsigned long *size, unsigned long *free);
View
141 firmware/target/hosted/android/fs-android.c
@@ -1,141 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2010 by Thomas Martitz
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-#include <stdlib.h>
-#include <sys/stat.h> /* stat() */
-#include <stdio.h> /* snprintf */
-#include <string.h> /* size_t */
-#include <dirent.h>
-#include <time.h> /* localtime() */
-#include "system-target.h"
-#include "dir-target.h"
-#include "file.h"
-#include "dir.h"
-#include "rbpaths.h"
-
-
-long filesize(int fd)
-{
- struct stat buf;
-
- if (!fstat(fd, &buf))
- return buf.st_size;
- else
- return -1;
-}
-
-/* do we really need this in the app? */
-void fat_size(unsigned long* size, unsigned long* free)
-{
- *size = *free = 0;
-}
-
-#undef opendir
-#undef closedir
-#undef mkdir
-#undef readdir
-
-/* need to wrap around DIR* because we need to save the parent's
- * directory path in order to determine dirinfo */
-struct __dir {
- DIR *dir;
- char *path;
-};
-
-DIR* _opendir(const char *name)
-{
- char *buf = malloc(sizeof(struct __dir) + strlen(name)+1);
- if (!buf)
- return NULL;
-
- struct __dir *this = (struct __dir*)buf;
-
- this->path = buf+sizeof(struct __dir);
- /* definitely fits due to strlen() */
- strcpy(this->path, name);
-
- this->dir = opendir(name);
-
- if (!this->dir)
- {
- free(buf);
- return NULL;
- }
- return (DIR*)this;
-}
-
-int _mkdir(const char *name)
-{
- return mkdir(name, 0777);
-}
-
-int _closedir(DIR *dir)
-{
- struct __dir *this = (struct __dir*)dir;
- int ret = closedir(this->dir);
- free(this);
- return ret;
-}
-
-struct dirent* _readdir(DIR* dir)
-{
- struct __dir *d = (struct __dir*)dir;
- return readdir(d->dir);
-}
-
-struct dirinfo dir_get_info(struct DIR* _parent, struct dirent *dir)
-{
- struct __dir *parent = (struct __dir*)_parent;
- struct stat s;
- struct tm *tm = NULL;
- struct dirinfo ret;
- char path[MAX_PATH];
-
- snprintf(path, sizeof(path), "%s/%s", parent->path, dir->d_name);
- memset(&ret, 0, sizeof(ret));
-
- if (!stat(path, &s))
- {
- if (S_ISDIR(s.st_mode))
- {
- ret.attribute = ATTR_DIRECTORY;
- }
- ret.size = s.st_size;
- tm = localtime(&(s.st_mtime));
- }
-
- if (!lstat(path, &s) && S_ISLNK(s.st_mode))
- {
- ret.attribute |= ATTR_LINK;
- }
-
- if (tm)
- {
- ret.wrtdate = ((tm->tm_year - 80) << 9) |
- ((tm->tm_mon + 1) << 5) |
- tm->tm_mday;
- ret.wrttime = (tm->tm_hour << 11) |
- (tm->tm_min << 5) |
- (tm->tm_sec >> 1);
- }
-
- return ret;
-}
View
117 firmware/target/hosted/android/kernel-android.c
@@ -1,117 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (c) 2010 Thomas Martitz
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-
-#include <time.h>
-#include <signal.h>
-#include <errno.h>
-#include <unistd.h>
-#include <pthread.h>
-#include "config.h"
-#include "system.h"
-#include "button.h"
-#include "audio.h"
-#include "panic.h"
-
-
-static pthread_cond_t wfi_cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t wfi_mtx = PTHREAD_MUTEX_INITIALIZER;
-/*
- * call tick tasks and wake the scheduler up */
-void timer_signal(union sigval arg)
-{
- (void)arg;
- call_tick_tasks();
- interrupt();
-}
-
-/*
- * wait on the sem which the signal handler posts to save cpu time (aka sleep)
- *
- * other mechanisms could use them as well */
-void wait_for_interrupt(void)
-{
- pthread_cond_wait(&wfi_cond, &wfi_mtx);
-}
-
-/*
- * Wakeup the kernel, if sleeping (shall not be called from a signal handler) */
-void interrupt(void)
-{
- pthread_cond_signal(&wfi_cond);
-}
-
-/*
- * setup a hrtimer to send a signal to our process every tick
- *
- * WARNING: JNI calls are not permitted from tick tasks, as the
- * underlying thread is not attached to the Java VM
- *
- * Can be possibly be attached if it really needs to be. but let's
- * keep this leightweight */
-void tick_start(unsigned int interval_in_ms)
-{
- int ret = 0;
- timer_t timerid;
- struct itimerspec ts;
- sigevent_t sigev;
-
- /* initializing in the declaration causes some weird warnings */
- memset(&sigev, 0, sizeof(sigevent_t));
- sigev.sigev_notify = SIGEV_THREAD,
- sigev.sigev_notify_function = timer_signal,
-
- ts.it_value.tv_sec = ts.it_interval.tv_sec = 0;
- ts.it_value.tv_nsec = ts.it_interval.tv_nsec = interval_in_ms*1000*1000;
-
- /* add the timer */
- ret |= timer_create(CLOCK_REALTIME, &sigev, &timerid);
- ret |= timer_settime(timerid, 0, &ts, NULL);
-
- /* Grab the mutex already now and leave it to this thread. We don't
- * care about race conditions when signaling the condition (because
- * they are not critical), but a mutex is necessary due to the API */
- pthread_mutex_lock(&wfi_mtx);
-
- if (ret != 0)
- panicf("%s(): %s\n", __func__, strerror(errno));
-}
-
-
-bool timer_register(int reg_prio, void (*unregister_callback)(void),
- long cycles, void (*timer_callback)(void))
-{
- (void)reg_prio;
- (void)unregister_callback;
- (void)cycles;
- (void)timer_callback;
- return false;
-}
-
-bool timer_set_period(long cycles)
-{
- (void)cycles;
- return false;
-}
-
-void timer_unregister(void)
-{
-}
View
11 firmware/target/hosted/android/system-target.h
@@ -18,22 +18,16 @@
* KIND, either express or implied.
*
****************************************************************************/
+
#ifndef __SYSTEM_TARGET_H__
#define __SYSTEM_TARGET_H__
-#define disable_irq()
-#define enable_irq()
-#define disable_irq_save() 0
-#define restore_irq(level) (void)level
+#include "kernel-unix.h"
static inline void commit_dcache(void) {}
static inline void commit_discard_dcache(void) {}
static inline void commit_discard_idcache(void) {}
-void power_off(void);
-void wait_for_interrupt(void);
-void interrupt(void);
-
/* don't pull in jni.h for every user of this file, it should be only needed
* within the target tree (if at all)
* define this before #including system.h or system-target.h */
@@ -47,4 +41,3 @@ extern JNIEnv* getJavaEnvironment(void);
#endif /* __SYSTEM_TARGET_H__ */
#define NEED_GENERIC_BYTESWAPS
-
View
65 firmware/target/hosted/debug-hosted.c
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (c) 2002 Daniel Stenberg
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef WIN32
+static unsigned old_cp;
+
+void debug_exit(void)
+{
+ /* Reset console output codepage */
+ SetConsoleOutputCP(old_cp);
+}
+
+void debug_init(void)
+{
+ old_cp = GetConsoleOutputCP();
+ /* Set console output codepage to UTF8. Only works
+ * correctly when the console uses a truetype font. */
+ SetConsoleOutputCP(65001);
+ atexit(debug_exit);
+}
+#else
+void debug_init(void)
+{
+ /* nothing to be done */
+}
+#endif
+
+void debugf(const char *fmt, ...)
+{
+ va_list ap;
+ va_start( ap, fmt );
+ vfprintf( stderr, fmt, ap );
+ va_end( ap );
+}
+
+void ldebugf(const char* file, int line, const char *fmt, ...)
+{
+ va_list ap;
+ va_start( ap, fmt );
+ fprintf( stderr, "%s:%d ", file, line );
+ vfprintf( stderr, fmt, ap );
+ va_end( ap );
+}
View
0 firmware/target/hosted/ypr0/fs-ypr0.c → firmware/target/hosted/filesystem-unix.c
File renamed without changes.
View
21 firmware/target/hosted/ypr0/kernel-ypr0.c → firmware/target/hosted/kernel-unix.c
@@ -20,6 +20,7 @@
****************************************************************************/
+#include <stdlib.h>
#include <time.h>
#include <signal.h>
#include <errno.h>
@@ -63,10 +64,13 @@ void interrupt(void)
/*
* setup a hrtimer to send a signal to our process every tick
+ *
+ * WARNING for Android: JNI calls are not permitted from tick tasks, as the
+ * underlying thread is not attached to the Java VM
+ *
+ * Can be possibly be attached if it really needs to be. but let's
+ * keep this leightweight
*/
-union sigval tick_arg = {
- .sival_int = 0,
-};
void tick_start(unsigned int interval_in_ms)
{
@@ -126,13 +130,13 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void),
if (timer_prio >= 0 && global_unreg_callback)
global_unreg_callback();
- /* initializing in the declaration causes some weird warnings */
memset(&sigev, 0, sizeof(sigevent_t));
sigev.sigev_notify = SIGEV_THREAD,
sigev.sigev_notify_function = timer_cb;
- ts.it_value.tv_sec = ts.it_interval.tv_sec = in_us / 1000000;
- ts.it_value.tv_nsec = ts.it_interval.tv_nsec = (in_us%1000000)*1000;
+ div_t q = div(in_us, 1000000);
+ ts.it_value.tv_sec = ts.it_interval.tv_sec = q.quot;
+ ts.it_value.tv_nsec = ts.it_interval.tv_nsec = q.rem*1000;
/* add the timer */
ret |= timer_create(CLOCK_REALTIME, &sigev, &timer_tid);
@@ -149,8 +153,9 @@ bool timer_set_period(long cycles)
{
struct itimerspec ts;
long in_us = cycles_to_microseconds(cycles);
- ts.it_value.tv_sec = ts.it_interval.tv_sec = in_us / 1000000;
- ts.it_value.tv_nsec = ts.it_interval.tv_nsec = (in_us%1000000)*1000;
+ div_t q = div(in_us, 1000000);
+ ts.it_value.tv_sec = ts.it_interval.tv_sec = q.quot;
+ ts.it_value.tv_nsec = ts.it_interval.tv_nsec = q.rem*1000;
return timer_settime(timer_tid, 0, &ts, NULL) == 0;
}
View
38 firmware/target/hosted/android/lc-android.c → firmware/target/hosted/kernel-unix.h
@@ -1,10 +1,10 @@
/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2010 by Thomas Martitz
@@ -19,22 +19,16 @@
*
****************************************************************************/
-#include <string.h> /* size_t */
-#include "load_code.h"
+#ifndef __KERNEL_UNIX_H__
+#define __KERNEL_UNIX_H__
-/* the load_code wrappers simply wrap, nothing to do */
-void *lc_open(const char *filename, unsigned char *buf, size_t buf_size)
-{
- return _lc_open(filename, buf, buf_size);
-}
+/* interrupt emulation incomplete, doesn't seem needed so far */
+#define disable_irq()
+#define enable_irq()
+#define disable_irq_save() 0
+#define restore_irq(level) (void)level
-void *lc_get_header(void *handle)
-{
- return _lc_get_header(handle);
-}
-
-void lc_close(void *handle)
-{
- _lc_close(handle);
-}
+void wait_for_interrupt(void);
+void interrupt(void);
+#endif /* __KERNEL_UNIX_H__ */
View
5 firmware/target/hosted/ypr0/lc-ypr0.c → firmware/target/hosted/lc-unix.c
@@ -22,7 +22,10 @@
#include <string.h> /* size_t */
#include "load_code.h"
-/* the load_code wrappers simply wrap, nothing to do */
+/* unix specific because WIN32 wants UCS instead of UTF-8, so filenames
+ * need to be converted */
+
+/* plain wrappers , nothing to do */
void *lc_open(const char *filename, unsigned char *buf, size_t buf_size)
{
return _lc_open(filename, buf, buf_size);
View
31 firmware/target/hosted/pcm-alsa.c
@@ -27,6 +27,11 @@
* This driver uses the so-called unsafe async callback method and hardcoded device
* names. It fails when the audio device is busy by other apps.
*
+ * To make the async callback safer, an alternative stack is installed, since
+ * it's run from a signal hanlder (which otherwise uses the user stack). If
+ * tick tasks are run from a signal handler too, please install
+ * an alternative stack for it too.
+ *
* TODO: Rewrite this to do it properly with multithreading
*
* Alternatively, a version using polling in a tick task is provided. While
@@ -76,6 +81,7 @@ static size_t pcm_size = 0;
#ifdef USE_ASYNC_CALLBACK
static snd_async_handler_t *ahandler;
static pthread_mutex_t pcm_mtx;
+static char signal_stack[SIGSTKSZ];
#else
static int recursion;
#endif
@@ -271,12 +277,37 @@ static int async_rw(snd_pcm_t *handle)
short *samples;
#ifdef USE_ASYNC_CALLBACK
+ /* assign alternative stack for the signal handlers */
+ stack_t ss = {
+ .ss_sp = signal_stack,
+ .ss_size = sizeof(signal_stack),
+ .ss_flags = 0
+ };
+ struct sigaction sa;
+
+ err = sigaltstack(&ss, NULL);
+ if (err < 0)
+ {
+ DEBUGF("Unable to install alternative signal stack: %s", strerror(err));
+ return err;
+ }
+
err = snd_async_add_pcm_handler(&ahandler, handle, async_callback, NULL);
if (err < 0)
{
DEBUGF("Unable to register async handler: %s\n", snd_strerror(err));
return err;
}
+
+ /* only modify the stack the handler runs on */
+ sigaction(SIGIO, NULL, &sa);
+ sa.sa_flags |= SA_ONSTACK;
+ err = sigaction(SIGIO, &sa, NULL);
+ if (err < 0)
+ {
+ DEBUGF("Unable to install alternative signal stack: %s", strerror(err));
+ return err;
+ }
#endif
/* fill buffer with silence to initiate playback without noisy click */
View
3 firmware/target/hosted/ypr0/ascodec-ypr0.c
@@ -50,10 +50,9 @@ struct codec_req_struct {
#define IOCTL_SUBREG_READ 0x80034103
-int ascodec_init(void)
+void ascodec_init(void)
{
afe_dev = open("/dev/afe", O_RDWR);
- return afe_dev;
}
void ascodec_close(void)
View
9 firmware/target/hosted/ypr0/dir-target.h
@@ -35,16 +35,9 @@ extern int rmdir(const char* name);
#define mkdir_uncached _mkdir
#define rmdir_uncached rmdir
-#define dirent_ypr0 dirent
-#define DIR_ypr0 DIR
-#define opendir_ypr0 _opendir
-#define readdir_ypr0 _readdir
-#define closedir_ypr0 _closedir
-#define mkdir_ypr0 _mkdir
-#define rmdir_ypr0 rmdir
-
extern DIR* _opendir(const char* name);
extern int _mkdir(const char* name);
+extern int _rmdir(const char* name);
extern int _closedir(DIR* dir);
extern struct dirent *_readdir(DIR* dir);
extern void fat_size(unsigned long *size, unsigned long *free);
View
2 firmware/target/hosted/ypr0/powermgmt-ypr0.c
@@ -22,7 +22,7 @@
#include "powermgmt.h"
#include "power.h"
#include "file.h"
-#include "as3514.h"
+#include "adc.h"
#include "sc900776.h"
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
View
8 firmware/target/hosted/ypr0/system-target.h
@@ -21,13 +21,7 @@
#ifndef __SYSTEM_TARGET_H__
#define __SYSTEM_TARGET_H__
-#define disable_irq()
-#define enable_irq()
-#define disable_irq_save() 0
-#define restore_irq(level) (void)level
-
-void wait_for_interrupt(void);
-void interrupt(void);
+#include "kernel-unix.h"
static inline void commit_dcache(void) {}
static inline void commit_discard_dcache(void) {}
View
17 lib/arm_support/arm_support.make
@@ -0,0 +1,17 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+#
+
+ARMSUPPORT_DIR = $(ROOTDIR)/lib/arm_support
+ARMSUPPORT_SRC = $(ARMSUPPORT_DIR)/support-arm.S
+ARMSUPPORT_OBJ := $(call c2obj, $(ARMSUPPORT_SRC))
+
+OTHER_SRC += $(ARMSUPPORT_SRC)
+
+$(LIBARMSUPPORT): $(ARMSUPPORT_OBJ)
+ $(SILENT)$(shell rm -f $@)
+ $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
View
0 firmware/target/arm/support-arm.S → lib/arm_support/support-arm.S
File renamed without changes.
View
1 tools/database/SOURCES
@@ -13,6 +13,7 @@ database.c
../../firmware/common/strcasestr.c
../../firmware/common/structec.c
../../firmware/common/unicode.c
+../../firmware/target/hosted/debug-hosted.c
../../firmware/logf.c
../../uisimulator/common/io.c
#if CONFIG_CODEC != SWCODEC
View
26 tools/root.make
@@ -70,9 +70,12 @@ ifeq (,$(findstring checkwps,$(APPSDIR)))
endif
endif
-#included before codecs.make and plugins.make so they see $(LIBSETJMP)
+#included before codecs.make and plugins.make so they see them)
ifndef APP_TYPE
include $(ROOTDIR)/lib/libsetjmp/libsetjmp.make
+ ifeq (arm,$(ARCH))
+ include $(ROOTDIR)/lib/arm_support/arm_support.make
+ endif
endif
ifneq (,$(findstring bootloader,$(APPSDIR)))
@@ -176,6 +179,13 @@ LINKRAM := $(BUILDDIR)/ram.link
ROMLDS := $(FIRMDIR)/rom.lds
LINKROM := $(BUILDDIR)/rom.link
+ifeq (arm,$(ARCH))
+ LIBARMSUPPORT_LINK := -larm_support
+else
+ LIBARMSUPPORT_LINK :=
+endif
+
+
$(LINKRAM): $(RAMLDS) $(CONFIGFILE)
$(call PRINTS,PP $(@F))
@@ -185,19 +195,21 @@ $(LINKROM): $(ROMLDS)
$(call PRINTS,PP $(@F))
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
-$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKRAM)
+$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(LINKRAM)
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
-L$(BUILDDIR)/firmware -lfirmware \
- -L$(BUILDDIR)/lib -lskin_parser \
+ -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \
-L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \
-lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
-T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map
-$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKROM)
+$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(LINKROM)
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
- $(VOICESPEEXLIB) $(FIRMLIB) -lgcc $(GLOBAL_LDOPTS) \
- -L$(BUILDDIR)/lib -lskin_parser \
- -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
+ -L$(BUILDDIR)/firmware -lfirmware \
+ -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \
+ -L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \
+ -lgcc $(GLOBAL_LDOPTS) \
+ -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
$(call PRINTS,OC $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@
View
40 uisimulator/common/io.c
@@ -608,46 +608,6 @@ void lc_close(void *handle)
}
#endif /* __PCTOOL__ */
-#ifdef WIN32
-static unsigned old_cp;
-
-void debug_exit(void)
-{
- /* Reset console output codepage */
- SetConsoleOutputCP(old_cp);
-}
-
-void debug_init(void)
-{
- old_cp = GetConsoleOutputCP();
- /* Set console output codepage to UTF8. Only works
- * correctly when the console uses a truetype font. */
- SetConsoleOutputCP(65001);
- atexit(debug_exit);
-}
-#else
-void debug_init(void)
-{
- /* nothing to be done */
-}
-#endif
-
-void debugf(const char *fmt, ...)
-{
- va_list ap;
- va_start( ap, fmt );
- vfprintf( stderr, fmt, ap );
- va_end( ap );
-}
-
-void ldebugf(const char* file, int line, const char *fmt, ...)
-{
- va_list ap;
- va_start( ap, fmt );
- fprintf( stderr, "%s:%d ", file, line );
- vfprintf( stderr, fmt, ap );
- va_end( ap );
-}
/* rockbox off_t may be different from system off_t */
int sim_ftruncate(int fd, long length)
View
3 uisimulator/uisimulator.make
@@ -31,7 +31,8 @@ $(SIMLIB): $$(SIMOBJ) $(UIBMP)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
$(BUILDDIR)/$(BINARY): $$(OBJ) $(SIMLIB) $(VOICESPEEXLIB) $(FIRMLIB) $(SKINLIB)
- $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(SIMLIB) $(LDOPTS) $(GLOBAL_LDOPTS)
+ $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(SIMLIB) $(LDOPTS) $(GLOBAL_LDOPTS) \
+ -Wl,-Map,$(BUILDDIR)/rockbox.map
$(BUILDDIR)/uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c
$(SILENT)mkdir -p $(dir $@)

No commit comments for this range

Something went wrong with that request. Please try again.