I have been working on a load-time configurable HAL multiplexer component.
http://pastebin.com/0D6p50DD

I was prompted by a user with a 5-output rotary gray-code switch, and
no HAL component to connect it to. (though it is possible to cascade
muxes, say with a pair of mux16 into a mux2 with msb or lsb triggering
the mux2).

At the moment the component is configured to allow up to 1024 values.
This is an arbitrary decision, of course.

The weird thing is that the pin-creation and basic functionality looks
OK up to 1023 items, but the moment I try for 1024 I get:

May 27 16:33:14 DN2800 kernel: [ 4707.522537] HAL: ERROR:
pin_new(mux_gen.00.in-s32-00) called with already-initialized memory
May 27 16:33:14 DN2800 kernel: [ 4707.522549] HAL: ERROR:
pin_new(mux_gen.00.in-s32-01) called with already-initialized memory
May 27 16:33:14 DN2800 kernel: [ 4707.522558] HAL: ERROR:
pin_new(mux_gen.00.in-s32-02) called with already-initialized memory
May 27 16:33:14 DN2800 kernel: [ 4707.522568] HAL: ERROR:
pin_new(mux_gen.00.in-s32-03) called with already-initialized memory
May 27 16:33:14 DN2800 kernel: [ 4707.522577] HAL: ERROR:
pin_new(mux_gen.00.in-s32-04) called with already-initialized memory
May 27 16:33:14 DN2800 kernel: [ 4707.522586] HAL: ERROR:
pin_new(mux_gen.00.in-s32-05) called with already-initialized memory

Noting that the  main difference between 1023 pins and 1024 is that
power-of two pins also create selector bits (I noticed this while
typing this email) I have observed that I get the same with
any number of values where the bit-selection pins are created. (and,
the higher the power-of-two, the more of the in-s32-NN pins are
created in pre-initialised memory. with a mux16 only …s32-00 and
…s32-01 are complained of.

This seems a bit odd. As far as I can see the hal_mallocs (code lines
172 and 221) should keep the pins separate?

If you want to compile and run the code, the problem can be seen with:
loadrt mux_generic config="su512"

-- 
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to