cregit-Linux how code gets into the kernel

Release 4.10 tools/testing/selftests/powerpc/tm/tm-fork.c

/*
 * Copyright 2015, Michael Neuling, IBM Corp.
 * Licensed under GPLv2.
 *
 * Edited: Rashmica Gupta, Nov 2015
 *
 * This test does a fork syscall inside a transaction. Basic sniff test
 * to see if we can enter the kernel during a transaction.
 */

#include <errno.h>
#include <inttypes.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include "utils.h"
#include "tm.h"


int test_fork(void) { SKIP_IF(!have_htm()); asm __volatile__( "tbegin.;" "blt 1f; " "li 0, 2;" /* fork syscall */ "sc ;" "tend.;" "1: ;" : : : "memory", "r0"); /* If we reach here, we've passed. Otherwise we've probably crashed * the kernel */ return 0; }

Contributors

PersonTokensPropCommitsCommitProp
rashmica guptarashmica gupta23100.00%1100.00%
Total23100.00%1100.00%


int main(int argc, char *argv[]) { return test_harness(test_fork, "tm_fork"); }

Contributors

PersonTokensPropCommitsCommitProp
rashmica guptarashmica gupta21100.00%1100.00%
Total21100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
rashmica guptarashmica gupta69100.00%1100.00%
Total69100.00%1100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.