Commit Graph

10 Commits

Author SHA1 Message Date
Alex Elder
ad480502eb parser: properly support 64-bit numbers
The language supports specifying 64-bit unsigned values, but the num
field of the token structure is not guaranteed to be 64 bits wide.
Change its type to be unsigned long long, and change the code that
parses numbers to use strtoull() so we can actually accept a 64-bit
value.

This is also true of the value field of the token type.  Change it
to unsigned long long as well (and format it as unsigned).

Check the return value of strtoull(), and if the result is out of
range, report an error.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-23-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:29:38 -05:00
Bjorn Andersson
8e5daab4a6 kernel: Introduce kernel-style generator
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-31 13:00:02 -08:00
Bjorn Andersson
06a2c5a19b accessor: Move accessor generators to one file
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 16:54:13 -08:00
Bjorn Andersson
a8c34af751 qmic: Extract all generators into functions
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 16:42:22 -08:00
Bjorn Andersson
63f0bedbda parser: Move message parsing to parser.c
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 16:10:54 -08:00
Bjorn Andersson
a3aa10545b qmic: Move simple type array to common file
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 16:06:33 -08:00
Bjorn Andersson
eaa0f3b8a5 parser: Move parser code from qmic.c to parser.c
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 16:03:50 -08:00
Bjorn Andersson
4c693b7551 qmic: Adopt common list implementation
Use the list implementation from other projects instead of rolling
custom list operations throughout the codebase.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 15:55:49 -08:00
Bjorn Andersson
9d4a317d4f qmic: Support specifying request, response or indication type
Allow specifying message type for the tlv support functions to verify
and create the right type of qmi header.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-02-07 21:24:02 -08:00
Bjorn Andersson
241fff829e qmic: Initial basic implementation
This initial implementation is capable of generating encoder and decoder
accessors for messages with basic integers, strings, arrays and structs.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-02-07 09:27:50 -08:00