/* * Copyright 2010 Tilera Corporation. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for * more details. * * Taken from the i386 architecture and simplified. */ #include <linux/mm.h> #include <linux/random.h> #include <linux/limits.h> #include <linux/sched/signal.h> #include <linux/sched/mm.h> #include <linux/mman.h> #include <linux/compat.h> /* * Top of mmap area (just below the process stack). * * Leave an at least ~128 MB hole. */ #define MIN_GAP (128*1024*1024) #define MAX_GAP (TASK_SIZE/6*5)
static inline unsigned long mmap_base(struct mm_struct *mm) { unsigned long gap = rlimit(RLIMIT_STACK); unsigned long random_factor = 0; if (current->flags & PF_RANDOMIZE) random_factor = get_random_int() % (1024*1024); if (gap < MIN_GAP) gap = MIN_GAP; else if (gap > MAX_GAP) gap = MAX_GAP; return PAGE_ALIGN(TASK_SIZE - gap - random_factor); }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Chris Metcalf | 78 | 100.00% | 1 | 100.00% |
Total | 78 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Chris Metcalf | 85 | 62.96% | 1 | 50.00% |
Tony Lu | 50 | 37.04% | 1 | 50.00% |
Total | 135 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Tony Lu | 19 | 90.48% | 1 | 50.00% |
Jason Cooper | 2 | 9.52% | 1 | 50.00% |
Total | 21 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Chris Metcalf | 191 | 71.80% | 1 | 20.00% |
Tony Lu | 69 | 25.94% | 1 | 20.00% |
Ingo Molnar | 4 | 1.50% | 2 | 40.00% |
Jason Cooper | 2 | 0.75% | 1 | 20.00% |
Total | 266 | 100.00% | 5 | 100.00% |