Skip to content

Commit

Permalink
Splitlock
Browse files Browse the repository at this point in the history
  • Loading branch information
andyhhp committed Feb 15, 2024
1 parent d1de27c commit 5b58ec7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/all-tests.dox
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ states.

@subpage test-msr - Print MSR information.

@subpage test-splitlock - Splitlock generator.

@subpage test-rtm-check - Probe for the RTM behaviour.


Expand Down
9 changes: 9 additions & 0 deletions tests/splitlock/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include $(ROOT)/build/common.mk

NAME := splitlock
CATEGORY := utility
TEST-ENVS := pv64 hvm64

obj-perenv += main.o

include $(ROOT)/build/gen.mk
33 changes: 33 additions & 0 deletions tests/splitlock/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @file tests/splitlock/main.c
* @ref test-splitlock
*
* @page test-splitlock splitlock
*
* @todo Docs for test-splitlock
*
* @see tests/splitlock/main.c
*/
#include <xtf.h>

const char test_title[] = "Test splitlock";

void test_main(void)
{
unsigned int *ptr = _p(KB(8) - 2);

for ( ;; )
asm volatile ("lock incl %0" : "+m" (*ptr));

xtf_success(NULL);
}

/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/

0 comments on commit 5b58ec7

Please sign in to comment.