Convert all references to PARSER_CONTEXT into struct parser_context.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
static ulong controlvm_payload_bytes_buffered;
-struct PARSER_CONTEXT_Tag {
+struct parser_context {
ulong allocbytes;
ulong param_bytes;
u8 *curr;
char data[0];
};
-static PARSER_CONTEXT *
+static struct parser_context *
parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
BOOL hasStandardPayloadHeader, BOOL *tryAgain)
{
- int allocbytes = sizeof(PARSER_CONTEXT) + bytes;
- PARSER_CONTEXT *rc = NULL;
- PARSER_CONTEXT *ctx = NULL;
+ int allocbytes = sizeof(struct parser_context) + bytes;
+ struct parser_context *rc = NULL;
+ struct parser_context *ctx = NULL;
struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
return rc;
}
-PARSER_CONTEXT *
+struct parser_context *
parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
{
return parser_init_guts(addr, bytes, isLocal, TRUE, tryAgain);
* structures. Afterwards, you can call parser_simpleString_get() or
* parser_byteStream_get() to obtain the data.
*/
-PARSER_CONTEXT *
+struct parser_context *
parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
{
return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain);
/* Obtain '\0'-terminated copy of string in payload area.
*/
char *
-parser_simpleString_get(PARSER_CONTEXT *ctx)
+parser_simpleString_get(struct parser_context *ctx)
{
if (!ctx->byte_stream)
return NULL;
/* Obtain a copy of the buffer in the payload area.
*/
void *
-parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
+parser_byteStream_get(struct parser_context *ctx, ulong *nbytes)
{
if (!ctx->byte_stream)
return NULL;
}
uuid_le
-parser_id_get(PARSER_CONTEXT *ctx)
+parser_id_get(struct parser_context *ctx)
{
struct spar_controlvm_parameters_header *phdr = NULL;
}
void
-parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string)
+parser_param_start(struct parser_context *ctx, PARSER_WHICH_STRING which_string)
{
struct spar_controlvm_parameters_header *phdr = NULL;
}
void
-parser_done(PARSER_CONTEXT *ctx)
+parser_done(struct parser_context *ctx)
{
if (!ctx)
return;
* parameter
*/
void *
-parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize)
+parser_param_get(struct parser_context *ctx, char *nam, int namesize)
{
u8 *pscan, *pnam = nam;
ulong nscan;
}
void *
-parser_string_get(PARSER_CONTEXT *ctx)
+parser_string_get(struct parser_context *ctx)
{
u8 *pscan;
ulong nscan;
PARSERSTRING_NAME,
} PARSER_WHICH_STRING;
-typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
-
-PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain);
-PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal,
+struct parser_context *parser_init(u64 addr, u32 bytes, BOOL isLocal,
+ BOOL *tryAgain);
+struct parser_context *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal,
BOOL *tryAgain);
-void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string);
-void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize);
-void *parser_string_get(PARSER_CONTEXT *ctx);
-uuid_le parser_id_get(PARSER_CONTEXT *ctx);
-char *parser_simpleString_get(PARSER_CONTEXT *ctx);
-void *parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
-void parser_done(PARSER_CONTEXT *ctx);
+void parser_param_start(struct parser_context *ctx,
+ PARSER_WHICH_STRING which_string);
+void *parser_param_get(struct parser_context *ctx, char *nam, int namesize);
+void *parser_string_get(struct parser_context *ctx);
+uuid_le parser_id_get(struct parser_context *ctx);
+char *parser_simpleString_get(struct parser_context *ctx);
+void *parser_byteStream_get(struct parser_context *ctx, ulong *nbytes);
+void parser_done(struct parser_context *ctx);
#endif
*/
struct putfile_buffer_entry {
struct list_head next; /* putfile_buffer_entry list */
- PARSER_CONTEXT *parser_ctx; /* points to buffer containing input data */
+ struct parser_context *parser_ctx; /* points to input data buffer */
};
/* List of struct putfile_request *, via next_putfile_request member.
*/
struct putfile_active_buffer {
/* a payload from a controlvm message, containing a file data buffer */
- PARSER_CONTEXT *parser_ctx;
+ struct parser_context *parser_ctx;
/* points within data area of parser_ctx to next byte of data */
u8 *pnext;
/* # bytes left from <pnext> to the end of this data buffer */
}
static void
-bus_configure(struct controlvm_message *inmsg, PARSER_CONTEXT *parser_ctx)
+bus_configure(struct controlvm_message *inmsg,
+ struct parser_context *parser_ctx)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->configure_bus.bus_no;
struct controlvm_message_packet *cmd = &inmsg.cmd;
u64 parametersAddr = 0;
u32 parametersBytes = 0;
- PARSER_CONTEXT *parser_ctx = NULL;
+ struct parser_context *parser_ctx = NULL;
BOOL isLocalAddr = FALSE;
struct controlvm_message ackmsg;