Commit Graph

61 Commits

Author SHA1 Message Date
Caleb Connolly
4574736afc parser: handle decimal '0' when parsing numbers
The commit 61f6fe9d1c ("parser: be more restrictive when parsing numbers")
introduced a bug where having a single '0' would cause a parser error
due to the base handling logic swallowing the ;. Fix this
and add a test to check for it.
2022-07-18 15:48:00 -05:00
Alex Elder
e61ff7276e parser: fix another test file
In "tests/num_large.qmi", the same name is used twice for constant
symbols, which results in a parse error.  Fix this test file bug.

Fixes: ad48050 ("parser: properly support 64-bit numbers")
Signed-off-by: Alex Elder <elder@linaro.org>
2021-10-08 17:05:42 -05:00
Alex Elder
de50c02678 parser: don't treat 8 as a valid octal digit
The function isodigit() was defined to mimic isxdigit(), indicating
whether a given character was an octal digit.  But as written, it
considers '8' to be a valid octal digit, which it is not.  Fix this
bug.

In addition, the "bad_octal.qmi" test file refers to an undefined
"test_struct" as a message member type.  Fix that by using u32
instead.

Fixes: 61f6fe9 ("parser: be more restrictive when parsing numbers")
Signed-off-by: Alex Elder <elder@linaro.org>
2021-10-08 17:01:32 -05:00
Alex Elder
4937e55261 parser: check the proper token number
In qmi_message_parse(), a check is made to ensure members defined
for a message are unique, both in name and number.  But the number
that's used in the comparison is the type token number, but should
be the member number token number.  Fix this bug.

Fixes: 72d1687 ("parser: disallow duplicate members")
Signed-off-by: Alex Elder <elder@linaro.org>
2021-10-08 17:00:50 -05:00
Alex Elder
ed896c97dc parser: add support for constant value substitution
Register symbolic constants as defined symbols when they are
defined.  When a constant symbol reference occurs after it's
been defined, the parsed token is modified to be a number type,
whose value is the value constant symbol.

One difference between a "normal" number token and a "constant"
number token is that the the string in a constant token contains
a copy of the symbolic name, whereas its a null pointer for a
"normal" number.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-35-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 14:19:51 -05:00
Alex Elder
2bd95bd13b parser: introduce token_name()
Create a new function token_name() that returns a printable string
representing a given token id.  Use it to simplify token_expect(),
eliminating its switch statement.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-34-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 14:19:12 -05:00
Alex Elder
624dcc7cc6 parser: refactor token_accept()
Invert the test at the top of token_accept(), to return immediatly
if the next token doesn't match the requested token id.

Change the type of the function to Boolean, and add a comment to
explain why we're freeing the token string (if present).

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-33-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 14:18:49 -05:00
Alex Elder
fae755df21 parser: introduce qmi_identifier_parse()
Pull the code that extracts an identifier from the input stream out
of yylex() and into a new helper function.  Create qmi_number_parse()
to do a similar thing for numbers.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-32-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 14:18:03 -05:00
Alex Elder
b793b576ff parser: introduce symbol_find()
Create a new helper function symbol_find() that determines whether
there exists a defined symbol having the given name.  It returns a
pointer to the symbol structure is returned if one exists, or a null
pointer otherwise.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-31-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 14:17:06 -05:00
Alex Elder
734ecff5a5 parser: refactor loops in yylex()
The first character in a symbol or numeric value in a number will not
go beyond the end of the token buffer.  Knowing this, the loops in
yylex() can be rearranged to use while () instead of do...while ().

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-30-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 14:16:34 -05:00
Alex Elder
b6b7384256 parser: assert symbol names are valid
Introduce symbol_valid(), which returns true only if a given symbol
name is valid.  A valid symbol begins with an alphabetic character
and consists otherwise of alphanumerics or '_'.  It also must be
representable in the token buffer.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-29-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 14:15:18 -05:00
Alex Elder
789c4e9d23 parser: avoid token buffer overflow
Define TOKEN_BUF_SIZE as the size of the buffer used when parsing
tokens.  Define TOKEN_BUF_MIN as the minimum size of the token
buffer; the size comes from what's necessary to represent a maximal
64-bit octal value.

Add checks in yylex() to avoid exhausting the token buffer on
pathological input.  Use the minimum buffer size to NUL-terminate
the buffer for a message if the token name is too long.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-28-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:35:07 -05:00
Alex Elder
72d1687658 parser: disallow duplicate members
Check each constant as it is recognized to ensure its name does not
duplicate an already-defined constant.

Check each message member as it is recognized to ensure its name
does not duplicate an already-defined member.  Also check its id
value to ensure the same value isn't used more than once.

Check each struct member as it is recognized to ensure its name does
not duplicate an already-defined member.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-27-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:34:46 -05:00
Alex Elder
83931b750f parser: introduce qmi_package_parse()
Rename parse_package() to be qmi_package_parse(), and have it assign
the qmi_package pointer internally rather returning it.  This makes
the function name match the pattern used for all other production
rules.

The one caller of qmi_package_parse() assumes the package name has
been specified.  When parsing has completed, check to ensure the
package is specified, and only allow it to be specified once.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-26-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:32:25 -05:00
Alex Elder
61f6fe9d1c parser: be more restrictive when parsing numbers
When a number is parsed, the leading one or two characters are used
to indicate whether the number should be interpreted as hexadecimal,
octal or decimal.

But because the parser accepts any digits regardless of the base, it
allows things like 039 to be treated as an octal number, despite '9'
not being a valid digit.  The previous commit makes matters even
worse, allowing [a-fA-F] to be accepted for octal or decimal values.
Such errors are caught (but ignored) later when converting the
accepted string into a number in strtoull().

We are already looking at the first character or two to determine
the base, *after* scanning the number.  Instead, determine the base
when the first one or two characters are first input, and restrict
which characters are accepted in the number based on that.

As a consequence, strtoul() will examine all of the characters
comprising the number (whereas previously it would stop if it
encountered invalid character for the base).

Finally, accept either "0x" or "0X" to indicate hexadecimal.

This doesn't actually change behavior much, but as long as we're
checking every character in a number for validity we might as well
be restrictive.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-25-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:32:01 -05:00
Alex Elder
84f213e584 parser: properly support hexadecimal numbers
In yylex(), when parsing a number, an attempt is made to allow
hexadecimal values to be interpreted if the second character of the
token being parsed is 'x'.  However the parser is only otherwise
permitting digits 0-9 to be used.  Fix this by using isxdigit()
rather than isdigit().

The result still permits nonsensical values to be accepted, but at
least hexidecimal values containing [a-fA-F] will be interpreted
correctly.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-24-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:30:21 -05:00
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
Alex Elder
26191dc4a9 parser: reset fixed flag each for each array
If a message contains an array, we need to reset the flag that
indicates whether it is a fixed array or not each time through the
loop parsing message members.  Otherwise a non-fixed array declared
after a fixed array will be marked as fixed.

Drop the "int" in the definition of the array_size local varaible in
qmi_message_parse() to be consistent with the rest of the program.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-22-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:28:56 -05:00
Alex Elder
69f032f380 parser: add support for comments
Add the ability for input files to have comments in them.  A comment
begins with a '#' character and continues through the end of the line.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-21-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:28:05 -05:00
Alex Elder
c172d15f2b parser: use stronger typing in the symbol structure
Refine the definition of the symbol structure with an anonymous
union to make it a little clearer whether a token describes a
message or a type.

In symbol_add(), be more explicit about the type of additional
arguments expected to be seen.  Add a name to the enumerated type
representing the defined "type" type values (U8, STRUCT, etc.).
And change the type of the type field in the symbol structure to
have that enumerated type.

Specifically, if the symbol being added is a message, the argument
that follows should be one of the message types (request, response,
or indication).  And if the symbol being added is a type, the next
argument is expected to be one of the "type" types.  This makes it a
little easier to understand what the code is doing.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-20-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:27:02 -05:00
Alex Elder
34a471e5e5 parser: rename and re-type token id symbols
The token field of the symbol structure is a token identifier (and
*not* the pointer to a token structure).  It is only ever assigned a
token_id value, so change its type to the token_id enumerated type,
and reinforce it by using token_id as the name of the field.

Similarly, change the id field of the token structure to have the
token_id enumerated type.

Change the token id arguments passed to symbol_add(), token_expect(),
and token_accept() functions to have the token_id enumerated type,
and rename them token_id.  Note that for symbol_add() this means we
need to add the default case to the switch, to avoid a compiler
warning.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-19-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:25:03 -05:00
Alex Elder
8fc49e139b parser: print program name with error messages
In yyerror(), prefix the line reporting the error with the program
name.  This makes the output consistent with the output of errx()
which reports memory allocation errors.

Note that this uses a GNU-only feature; if that's not desirable it's
easy to do this more portably.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-18-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:24:04 -05:00
Alex Elder
32c0632957 parser: introduce memalloc() macro
Create a new macro that allocates and zeroes a block of memory,
which guarantees that the allocation will succeed.  Use this in two
spots where calloc() is already assumed not to fail, and use it in
other places where memory is dynamically allocated.

If the malloc() call in the macro fails, memalloc() will call errx()
to print an error message to stderr and exit with status 1.

In addition, check for a null pointer returned by strdup() in
yylex(), and report a similar error if that occurs.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-17-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:23:10 -05:00
Alex Elder
dcc2397921 parser: use stderr for error messages
Send error text output by yyerror() to stderr instead of stdout.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-16-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:22:33 -05:00
Alex Elder
dcec18722a parser: use token_expect() instead of token_accept()
If parse_package() finds anything other than an identifier as the
next token, it calls yyerror().  This is exactly what token_expect()
does, so use that instead.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-15-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:22:21 -05:00
Alex Elder
f80136eb08 parser: use standard I/O for input buffering
Rather than maintaining an input buffer and details about its
current state--as well as a lookahead character--just let the
standard I/O library take care of those details.  A single character
of "lookahead" is guaranteed by the library, so this will be no
worse than the hand-done buffering, and will certainly be more
robust.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-14-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:21:48 -05:00
Alex Elder
c7c8e47f74 parser: only one lookahead byte is required
The scratch_buf[] array is used to hold characters supplied to
unput().

The only time unput() is called is in yylex(), when a character
returned by input() isn't in the character set appropriate for the
symbol being parsed.  And in that case unput() is called only once.

We will not call unput() again until input() has been called at
least once, and that will consume the only character in the scratch
buffer.

Therefore, for our purposes, only one character is required for the
lookahead buffer.

We never accept a NUL byte on input, so it will never be used as a
lookahead character.  So we can use 0 as a special lookahead value
that indicates "no lookahead present."

So replace the scratch_buf[] and scratch_pos with a single character
lookahead, which is considered invalid if its value is 0.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-13-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:21:00 -05:00
Alex Elder
fad43b91d2 parser: use CHAR_MAX to define non-ASCII token id values
The first token id is given the value 256.  This ensures it is
outside the range of any valid character.

But we don't allow non-ASCII characters on input, so we can use 128
as the first non-character token id value.  Represent this as
(CHAR_MAX + 1), to make explicit the reason this value is chosen.

Give the enumerated type representing token ids a name.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-12-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:20:00 -05:00
Alex Elder
b246e6d86f parser: introduce TOK_EOF
Define an explicit end-of-file token, TOK_EOF.  When EOF is reached,
input() returns 0.  Use a symbolic TOK_EOF value rather than 0 to
represent that condition.

Note that also implies '\0' is not a valid input character; add an
explicit check to disallow a NUL byte on input.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-11-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:19:24 -05:00
Alex Elder
e8fd1bafda parser: permit only ASCII characters in input
Report an error if any input byte is not an ASCII character.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-10-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:18:42 -05:00
Alex Elder
6b15855aad parser: make input() return char
Now that read errors are dealt with immediately, input() will never
return anything but a character.  Change its return type to char,
and change the type of the variable in yylex() that holds its return
value to char as well.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-9-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:18:31 -05:00
Alex Elder
28c48a5e18 parser: report input read errors
In qmi_parse(), the main loop accepts tokens until it sees one with
id 0.  If an unrecognized (or unexpected) token is encountered, it
reports an error and exits using yyerror().

Normally, input() returns the next character to be processed while
parsing.  If the read() call in input() encounters an error, input()
will return -1 instead (which happens to be EOF).

The only caller of input() is yylex().  It recognizes tokens
comprised of alphanumeric characters and '_'.  If input() returns
any other value, it uses that value as the token identifier.  And in
particular, if input() returns -1, that will be the value stored in
the id field of the token structure yylex() returns.

So, back to the top, qmi_parse() will not consider -1 a valid token
id, and will report the read error as an "unexpected symbol".

Instead, report a read error immediately when it occurs and exit.
Move the definition of yyerror() earlier in the source file so it
can be called from yylex() (and all other functions) without needing
a declaration.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-8-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:17:46 -05:00
Alex Elder
53dc3278af parser: free unused message token strings
In qmi_parse(), when a message token is recognized its token
structure will contain a dynamically-allocated string continaing the
message name.  We only use the message identifier (number) though,
and as a result the message name gets leaked.  Fix this by freeing
the type token string if no-null.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-7-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:16:23 -05:00
Alex Elder
61da0f8fda parser: free unused type token strings
In qmi_message_parse(), the type token for each field parsed will
contain a dynamically-allocated string continaing the field type.
We only use the type identifier (number) though, and as a result
the type name gets leaked.  Fix this by freeing the type token
string if non-null.

Essentially the same thing occurs in qmi_struct_parse() while
parsing the fields of a message.  Fix the problem there as well.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-6-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:15:25 -05:00
Alex Elder
405e4e2b01 parser: free unused token strings in token_accept()
If token_accept() is provided a null token pointer argument, the
previous "current" token is discarded.  If the token matched is a
symbol type, the token string (which will have been dynamically
allocated in yylex()) will be leaked.

Fix this by freeing the current token string if token pointer passed
is null.

The compiler warns when we attempt to free a pointer to constant
data, so change the type of the string pointer in the symbol
structure to be pointer to non-constant.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-5-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:13:43 -05:00
Alex Elder
23710a79b3 parser: don't bother with a buffer in yyerror()
Just print the message passed to yyerror(); don't bother putting it
into a buffer first.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-4-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:11:56 -05:00
Alex Elder
8dcad17a55 parser: use unsigned for array indexes
We have no use for negative array indexes, so change the types of
the static variables scratch_pos, input_pos, and input_len to be
unsigned.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-3-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:11:26 -05:00
Alex Elder
0d92483f4a parser: get rid of a pointless loop in yylex()
A loop at the top of yylex() traverses the symbols list without
doing anything.  It serves no purpose, so get rid of it.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-2-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:11:10 -05:00
Bjorn Andersson
815dd495eb kernel: Support having strings in structs
Add handling for strings in structs in the kernel-style code generator.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-06-29 14:12:50 -07:00
Khem Raj
4ad63502c5 Makefile: Allow compiler/linker flags to be overridden
This helps with cross compilation where toolchains specify
certain flags via environment e.g. CFLAGS/LDFLAGS

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-05 21:54:21 -08:00
Bjorn Andersson
3f62f9ba1e kernel: Support static arrays
Statically sized arrays should not have a len property and should be
marked as STATIC_ARRAY in the elem_info list.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-02-15 12:46:19 -08: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
6f19b29065 parser: Tidy up parser after move
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 16:18:13 -08:00
Bjorn Andersson
7e7d2a2a17 parser: Move struct parser to parser.c
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-30 16:13:06 -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