~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/sparc/kernel/sys_sparc_64.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
}
361
361
EXPORT_SYMBOL(get_fb_unmapped_area);
362
362
 
363
 
/* Essentially the same as PowerPC... */
 
363
/* Essentially the same as PowerPC.  */
 
364
static unsigned long mmap_rnd(void)
 
365
{
 
366
        unsigned long rnd = 0UL;
 
367
 
 
368
        if (current->flags & PF_RANDOMIZE) {
 
369
                unsigned long val = get_random_int();
 
370
                if (test_thread_flag(TIF_32BIT))
 
371
                        rnd = (val % (1UL << (22UL-PAGE_SHIFT)));
 
372
                else
 
373
                        rnd = (val % (1UL << (29UL-PAGE_SHIFT)));
 
374
        }
 
375
        return (rnd << PAGE_SHIFT) * 2;
 
376
}
 
377
 
364
378
void arch_pick_mmap_layout(struct mm_struct *mm)
365
379
{
366
 
        unsigned long random_factor = 0UL;
 
380
        unsigned long random_factor = mmap_rnd();
367
381
        unsigned long gap;
368
382
 
369
 
        if (current->flags & PF_RANDOMIZE) {
370
 
                random_factor = get_random_int();
371
 
                if (test_thread_flag(TIF_32BIT))
372
 
                        random_factor &= ((1 * 1024 * 1024) - 1);
373
 
                else
374
 
                        random_factor = ((random_factor << PAGE_SHIFT) &
375
 
                                         0xffffffffUL);
376
 
        }
377
 
 
378
383
        /*
379
384
         * Fall back to the standard layout if the personality
380
385
         * bit is set, or if the expected stack growth is unlimited:
455
460
                default:
456
461
                        err = -ENOSYS;
457
462
                        goto out;
458
 
                };
 
463
                }
459
464
        }
460
465
        if (call <= MSGCTL) {
461
466
                switch (call) {
476
481
                default:
477
482
                        err = -ENOSYS;
478
483
                        goto out;
479
 
                };
 
484
                }
480
485
        }
481
486
        if (call <= SHMCTL) {
482
487
                switch (call) {
502
507
                default:
503
508
                        err = -ENOSYS;
504
509
                        goto out;
505
 
                };
 
510
                }
506
511
        } else {
507
512
                err = -ENOSYS;
508
513
        }