/*
 * Copyright 2014, NICTA
 *
 * This software may be distributed and modified according to the terms of
 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
 * See "LICENSE_BSD2.txt" for details.
 *
 * @TAG(NICTA_BSD)
 */

#include <camkes.h>
#include <stdio.h>
#include <string.h>
#include <sel4/sel4.h>

int run(void) {
    char *shello = "hello world";

    printf("Starting...\n");
    printf("-----------\n");

    strcpy((void*)DataOut, shello);
    while(!*((char*)DataIn))
        seL4_Yield();
    printf("%s read %s\n", get_instance_name(), (char*)DataIn);
    return 0;
}

/*
 * Copyright 2014, NICTA
 *
 * This software may be distributed and modified according to the terms of
 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
 * See "LICENSE_BSD2.txt" for details.
 *
 * @TAG(NICTA_BSD)
 */

#include <camkes.h>
#include <stdio.h>
#include <string.h>

int run(void) {
    char *shello = "hello world";

    printf("Starting...\n");
    printf("-----------\n");

    strcpy((void*)DataOut, shello);
    while(!*((volatile char*)DataIn));
    printf("%s read %s\n", get_instance_name(), (char*)DataIn);
    return 0;
}

Remove casting away of volatile and explicit call to seL4_Yield.
Remove casting away of volatile and explicit call to seL4_Yield.

This commit removes some bad style in this example. In particular, calling a
seL4 system call directly from a CAmkES component is not intended. Additionally
this example cast away the volatility of the dataport pointer. From what I can
see, the only reason the compiler did not optimise away the repeated read of
this pointer was because the loop contained a system call with a contained
unrestricted memory clobber.

Related to JIRA CAMKES-436
