aboutsummaryrefslogtreecommitdiff
path: root/ccan
AgeCommit message (Collapse)AuthorFilesLines
2020-02-26list: Add list_add_after()Vasant Hegde1-0/+19
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-11-07libstb/secvar: add secvar api implementationEric Richter1-0/+38
This patch provides the OPAL runtime service frontend for the host OS to retrieve secure variables, and append new ones for processing on the next reboot. These calls operate on the internal abstraction or utilize the platform-provided driver hooks, and therefore this API should not need to be updated to support changes in storage or backend drivers. Included are the following functions: - opal_secvar_get() - opal_secvar_get_next() - opal_secvar_enqueue_update() opal_secvar_get() retrieves the data blob associated with a given key. The data buffer may be set to NULL to only query for variable size. This runtime service only operates on the variable bank. opal_secvar_get_next() can be used to iterate through the list of variable keys in the variable bank. Supplying an empty key (or zero key length) returns the key of the first variable in the variable bank. Supplying a valid key returns the key of the next variable in sequence. opal_secvar_enqueue_update() provides a method for the host OS to submit a new variable for processing on next boot, by appending it to the update bank. As this does not affect the variable bank, appending a variable via this runtime service will not affect the output of the previous set of functions. The update queue is only processed during secvar initialization. Signed-off-by: Eric Richter <erichte@linux.ibm.com> [oliver: style fixes] Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- V2: - removed opal_secvar_backend, replaced by DT node - removed unnecessary argument casting - all calls return OPAL_RESOURCE if secvar failed to init V3: - remove metadata from API parameters - remove opal_secvar_get_size - change enqueue to replace an update with a repeat name, rather than enqueueing the duplicate - change enqueue to unstage an update matching a key if size is zero - make all key parameters const where possible - rename key_size to key_buf_size in _get_next - fix leaking node when enqueue could not allocate the secvar V4: - enqueue update now uses secvar alloc/realloc - use storage-defined max var size instead of hardcoded constant
2019-10-02ccan: Add CCAN heap licenseJordan Niethe1-1/+17
In commit 3d6aca20b8ae ("ccan: Add CCAN heap source") the license file is a symbolic link. The link points to the BSD-MIT license within the CCAN project, but in skiboot this location does not exist. Replace the link with the BSD-MIT license text. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-05-20ccan: Add CCAN heap sourceJordan Niethe6-2/+445
We would like to be able to use dump_trace to dump multiple trace buffers at a time. The entries should be displayed in timestamp order. As each buffer is already ordered on timestamp, a k-way merge is an efficient method to sort the buffers together by timestamp. A heap can be used to implement a k-way merge. As CCAN is already included in Skiboot, use the CCAN heap. Add the source for heap. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> [stewart: ccan/heap: Make test run quieter] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-02-28build: use thin archives rather than incremental linkingNicholas Piggin1-1/+1
This changes to build system to use thin archives rather than incremental linking for built-in.o, similar to recent change to Linux. built-in.o is renamed to built-in.a, and is created as a thin archive with no index, for speed and size. All built-in.a are aggregated into a skiboot.tmp.a which is a thin archive built with an index, making it suitable or linking. This is input into the final link. The advantags of build size and linker code placement flexibility are not as great with skiboot as a bigger project like Linux, but it's a conceptually better way to build, and is more compatible with link time optimisation in toolchains which might be interesting for skiboot particularly for size reductions. Size of build tree before this patch is 34.4MB, afterwards 23.1MB. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-19Add glibc style endianess check in CCANAkshay Adiga1-0/+9
CCAN adds support for glibc style in the following commit : https://github.com/rustyrussell/ccan/commit/759ac0f0564104d5028acd47c3e9fdb858c96d1d Signed-off-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com> Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-07-19attrconst for testsStewart Smith6-6/+6
Fixes build warnings when running with higher optimization than -O0 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-02consolidate gcov flags into HOSTGCOVFLAGS for host binariesStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-08-18ccan/list: Add list_empty_nocheckBenjamin Herrenschmidt1-0/+15
This is the same as list_empty but without the debug checks. This is useful when wanting to check for an empty list without locks held, potentially racing with addition/removal, which can be a valid thing to do under some circumstances. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20Fix for typosFrederic Bonnard1-4/+4
While reviewing the Debian packaging, codespell found those. Most proposed fixes are based on codespell's default dictionnary. Signed-off-by: Frederic Bonnard <frediz@linux.vnet.ibm.com> Reviewed-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-08-13ccan: Update short_types module to fix warningJoel Stanley4-22/+40
Back in 9f64cb2028f8612daa8556cc4831b9b7ce91b171 the ccan/endian module was updated. Unknown at the time, there were changes made to both the endian and short_types modules that depnded on each other, or certain types would be redefined. skiboot/ccan/endian/endian.h:336:19: error: redefinition of typedef 'be32' is a C11 feature [-Werror,-Wtypedef-redefinition] typedef beint32_t be32; ^ skiboot/ccan/short_types/short_types.h:22:18: note: previous definition is here typedef uint32_t be32; ^ By updating the short_types to the latest, we no longer redefine these types when a module uses both short_types and endian. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-09Fix commit 16c80346Jeremy Kerr1-2/+2
Commit 16c80346 change included some reverts of previous commits, which we need. This change reverts those reverts, leaving the original intent of that change. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-05Add OPAL_INVALID_CALL explicitly in opal.h and docsStewart Smith1-2/+2
Was mentioned in linux as possibly being used by some external test modules. It's harmless to make this official behaviour. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-05Makefile: clean the gcov files created during coverageNeelesh Gupta1-2/+2
Fix the Makefile to clean up the coverage data files generated through gcov. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-18Run the CCAN unit tests and add to coverage-reportStewart Smith16-2/+145
With some fun Makefile rules, we can pick up all CCAN unit tests. We exclude the unit test source files from the lcov report itself. Add skeleton ccan config.h and tap.h that are enough for us to build and run the test suite. Currently, the minimalist versions should be fine (and we don't need CCAN configurator). Also includes -Werror fixes for ccan tests. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28Remove vsprintf: just like sprintf, vsnprintf is a much better ideaStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-07list: Add list_add_beforeBenjamin Herrenschmidt1-0/+19
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-18ccan/endian: fix cpu_to_be64 on big-endianJeremy Kerr1-1/+0
Commit 9f64cb20 introduced a spurious unconditional byteswap, which we don't need for HAVE_BIG_ENDIAN. Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
2014-08-15ccan/endian: Update endian moduleJoel Stanley3-51/+86
This pulls in a fix for warnings in our tests: hdata/test/../spira.c:64:64: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses] .addr = CPU_TO_BE64((unsigned long)&(cpu_ctl_sp_attn_area1) + SKIBOOT_BASE) Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt72-0/+3456
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>