This repository has been archived by the owner on Feb 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 951
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sysdeps/x86_64/memset.S: Add sfence after movnti.
- Loading branch information
Ulrich Drepper
committed
Nov 8, 2007
1 parent
f2a8406
commit f6ed654
Showing
8 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include <errno.h> | ||
#include <pthread.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
#include <sys/mman.h> | ||
#include <sys/resource.h> | ||
|
||
static void | ||
use_up_memory (void) | ||
{ | ||
struct rlimit rl; | ||
getrlimit (RLIMIT_AS, &rl); | ||
rl.rlim_cur = 10 * 1024 * 1024; | ||
setrlimit (RLIMIT_AS, &rl); | ||
|
||
char *c; | ||
int PAGESIZE = getpagesize (); | ||
while (1) | ||
{ | ||
c = mmap (NULL, PAGESIZE, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); | ||
if (c == MAP_FAILED) | ||
break; | ||
} | ||
} | ||
|
||
static void * | ||
child (void *arg) | ||
{ | ||
sleep (1); | ||
return arg; | ||
} | ||
|
||
static int | ||
do_test (void) | ||
{ | ||
int err; | ||
pthread_t tid; | ||
|
||
use_up_memory (); | ||
|
||
err = pthread_create (&tid, NULL, child, NULL); | ||
if (err != 0) | ||
{ | ||
printf ("pthread_create returns %d: %s\n", err, | ||
err == EAGAIN ? "OK" : "FAIL"); | ||
return err != EAGAIN; | ||
} | ||
|
||
/* We did not fail to allocate memory despite the preparation. Oh well. */ | ||
return 0; | ||
} | ||
|
||
#define TEST_FUNCTION do_test () | ||
#include "../test-skeleton.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,7 @@ L(memset_entry): | |
add $0x40,%rcx | ||
dec %rax | ||
jne 11b | ||
sfence | ||
jmp 4b | ||
|
||
END (memset) | ||
|