Commit 3cfbedc7 authored by Joakim Bech's avatar Joakim Bech
Browse files

tmp-commit testing flags


Signed-off-by: Joakim Bech's avatarJoakim Bech <joakim.bech@linaro.org>
parent 71c5a23f
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <stdio.h>
//#include <cheri.h>
//#include <cheriintrin.h>
#include <cheriintrin.h>
#include <hello_morello.h>
static void pointer_comparison(void)
{
int *a = NULL;
int *b = NULL;
printf("a == b : %s\n", a == b ? "true" : "false");
}
static bool is_page_aligned(void *a)
{
return __builtin_is_aligned(a, 4096);
}
static void aligned_pointers(void)
{
int *a = NULL;
if (is_page_aligned(a))
printf("a is page aligned\n");
else
printf("a is not page aligned\n");
}
/*
* FIXME: Shouldn't this trigger a warning/error when the flag
* "-Werror=mips-cheri-prototypes" is set?
*/
static void no_prototype()
{
return;
}
#if 0
static void capability_addr(void)
{
int *a = NULL;
//vaddr_t t; //= cheri_address_get(a);
//printf("cheri_address: %s\n", t);
bool b = cheri_tag_get(void a);
}
static char* loss_of_provenance(long p)
{
return strdup((const char *)p);
}
#endif
static int complete_context(int a, void *b) {
(void)b;
return a;
}
int iface_enumerate(void *b, int (*callback)(int, void*)) {
(void)b;
(void)callback;
return 0;
}
int main()
{
//long p = 0;
int a = 0;
printf("Hello world - Morello - Pure-capability\n");
pointer_comparison();
aligned_pointers();
no_prototype();
// capability_addr();
// loss_of_provenance(p);
a = iface_enumerate(&a, complete_context);
return 0;
}
#ifdef _HELLO_MORELLO_H
#define _HELLO_MORELLO_H
#endif
#ifndef _HELLO_MORELLO_H
#define _HELLO_MORELLO_H
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment