Add INIT_ATTR to some low-hanging fruit in the X1000 code:
GPIO init, GPIO initial state tables, clock init, and DMA init.
Change-Id: Ia02b20945da1bbed103e2e01eaf60553eb5f72d4
Enable INIT_ATTR support in config.h. Load init code to the
codec buffer, following the convention used by other targets
that support INIT_ATTR.
Change-Id: I8935fbaa100f0013bb328d71c4a49ec2ffafd003
check for invalid userdata by assigning the address of 'invalid_userdata'
this cleans up the functions a bit and removes some extra conditionals
Change-Id: Ic5e13147796e629010a1436eb60042f6550a959c
The font code expects the full path to be stored in the
buflib alloc so this breaks eg. saving the glyph cache.
This reverts commit 2b4a4070c9.
Change-Id: I53844c39b34b14f7c8e5999825c1d012fa3f74dc
As those form factors are typically not runtime removable and as such
expect to always being powered up.
This is an experimental change, and we might revert it if it doens't help
Change-Id: I61187f297866f64589a546352828a0ff8169fa30
HAVE_MULTIVOLUME is a subset of HAVE_MULTIDRIVE
in normal circumstances they are interchangable
but when the internal drive is not found the assumption falls apart
at the moment most of the bootloader are less selective about what drives/volumes
they will mount therefore the volume might not match between what the bootloader
returns for multiboot and what the firmware sees
updating bootloaders will fix this but it should probably be made more robust
at the same time
Change-Id: I93acd4a539894f093211b74b030df3b2c6a0aa11
This is a small wrapper function which calls other init code
and is only called from init code; mark it INIT_ATTR to fix
the unsafe reference.
Change-Id: I5525461e9fd63955c6396d3151d209c457b3d798
Avoid startup code clashing with the .init section, which is
by convention used for INIT_ATTR code that can be discarded
after app initialization.
Change-Id: Id59b7618ef41e65c33fc0f133644e07555a913eb
Get the linker to automatically assign load addresses for
the .iram and .tcsm sections. Taken from the i.MX31 linker
script.
Change-Id: Ic03d577d8690c777726daf373a3289316639bfb9
This flash chip is found on some Surfans F20 units. For our purposes
it's the same as the GD5F1GA4xExx so just #define an alias instead of
adding a whole new chip struct.
Change-Id: I2f4c4fbf1faf3a0c7a1503534430afacbddc426e
replace applicable calls to strlcpy with calls to strmemccpy
which null terminates on truncation
in theory the strmemccpy calls should be slightly faster since they
don't traverse the rest of the source string on truncation
but I seriously doubt there is too much of that going on in the code base
Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
Not sure if this is worth the added bin size yet but I will
see where I can use it to try and make it worth it
Change-Id: Icc299d3986172ff224a14be48da3bf065d728a66
splits on spaces also considers \r\n\f\v\t as mandatory breaks
I'm still working on the strptokspn function
my goal is to use it directly rather than storing the matched char
and modifying the source string with \0 in order to tokenize the output
--Done
Change-Id: I7f378b5b9c4df8f10899b9a55a98950afb3931dc
The bootloader backup is intentionally simple, but it's a little
*too* simple. Add a sanity check to make sure what we're backing
up or restoring contains the first 8 bytes of the SPL header.
This isn't going to catch all possible problems, but it'll stop
obviously non-functional backups from being restored.
Change-Id: I6e80351aeb96c467f0514bd0ecd77d94ff72a8f8
Merge the x1000 and jz47xx exception handling code since they use
the same exception vectors and handlers. The interrupt handler is
now called from the common exception vector, but remains separate
for each board since they have different IRQ layouts.
The new exception handler can provide a stack traceback from the
interrupted code, rather than the (uninteresting) caller traceback
displayed by panicf. This allows you to see what led up to a null
pointer deref or division by zero, which makes it _much_ easier to
track down errors that occur in common leaf functions like strcmp.
Change-Id: I59a0ebb5e40fcb36505c3bfdb47f8cac2f9936b1
The original drawmode change was "x = (~x & INVERSEVID) | SOLID"
which is essentially XOR'ing the INVERSEVID bit, but I changed it
to mask out INVERSEVID by mistake.
Fixes 44b9785465.
Change-Id: I87b059b89aea9c31a8ff408016264285e67ca80c
Several places in the codebase implemented an ad-hoc form of pinning;
they can be converted to use buflib pinning instead.
Change-Id: I4450be007e80f6c9cc9f56c2929fa4b9b85ebff3
When I converted all the clipping checks in 4b8fe8acd1 I messed
up the hline and vline checks. This produced some weird panics on
the Shanling Q1, probably memory corruption -- but somehow it got
past AddressSanitizer. Go figure.
Change-Id: I84820c23a491d422218c72d2d5e199e2fc7def0f
allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free
Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
Simplify update_viewport() by calling update_viewport_rect().
The resulting LCD driver calls are the same either way and
for some reason, update_viewport() didn't handle non-default
stride viewports correctly.
Change-Id: Ic34d3d40e4f758db897cb3944d9d7475bbdb4d2c
clear_display() on grayscale LCDs sets the number of scrolling
lines to 0 but that's wrong, the scollers need to be shut down
first. Call scroll_stop() for that, as is done on color LCDs.
Change-Id: I75fb6839ed04f6fe1eb8e2855c8db820fcedddb8
There's no need to generate separate copies of these functions
for main and remote LCDs; we can just pass the viewport directly.
Change-Id: I20aa04a58d327b479a942708e161068bd6a3357b