On Apr 3, 2013, at 4:47 PM, Florian Fainelli wrote: > Did you also enable a MIPS16 build of the kernel or just user-space for now?
Just user-space. I think there may be large parts of the kernel which can be built in mips16. Because the rest of the mailing list probably doesn't read all the tickets :-) I'll give the background. In https://dev.openwrt.org/ticket/12318, I had noticed Realtek seems to run some mips16 code in-kernel. I think this is important to them because they have some on-chip RAM/reserved cache, but only a 16-bit external RAM interface in some configurations. Interrupt handlers which can fit into the on-chip memory have fast and semi-deterministic response time. But code density is important. I've got a recent Realtek GPL source dump somewhere around here. The wive-ng folks have some of this online too. In the ticket I mention a 10MB commit[1] containing a kernel/arch/mips/lib/mips16_lib.c [2] with stuff in it like int _test_and_clear_bit(int nr, volatile void *addr) { return test_and_clear_bit(nr, addr); } which is compiled in 32-bit mode. This lets mips16 code do 32-bit-only operations at the cost of a cross-mode function call without much more than a bunch of #defines. One hazard to this is...hazards. There may be additional cycles required between mtc0/mfc0/etc processor manipulation and mode switches, and this is not something customers have tested widely. The RTL kernel linker script seems to have .iram and .dram sections which are perhaps icache and dcache reserved as locked RAM. You can see something that looks like it's linked into an .iram section at [3]. Jay [1]: http://wive-ng.git.sourceforge.net/git/gitweb.cgi?p=wive-ng/wive-ng;a=commitdiff_plain;h=f70052ba21382a2cc939601423419bee9d4558f9 [2]: http://wive-ng.git.sourceforge.net/git/gitweb.cgi?p=wive-ng/wive-ng;a=blob;f=kernel/arch/mips/lib/mips16_lib.c;hb=HEAD [3]: http://wive-ng.git.sourceforge.net/git/gitweb.cgi?p=wive-ng/wive-ng;a=blob;f=kernel/drivers/net/rtl865x/swNic_poll.c;h=cb23f44977ff23483643a861444daae7892c142c;hb=HEAD#l530 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel