source: trunk/target/linux/generic/patches-2.6.37/941-ocf_20100325.patch @ 26692

Last change on this file since 26692 was 26692, checked in by nbd, 5 years ago

kernel: reorganize 2.6.37 patches

File size: 5.2 KB
  • drivers/char/random.c

    a b  
    129129 *                                unsigned int value); 
    130130 *      void add_interrupt_randomness(int irq); 
    131131 * 
     132 *      void random_input_words(__u32 *buf, size_t wordcount, int ent_count) 
     133 *      int random_input_wait(void); 
     134 * 
    132135 * add_input_randomness() uses the input layer interrupt timing, as well as 
    133136 * the event type information from the hardware. 
    134137 * 
     
    140143 * a better measure, since the timing of the disk interrupts are more 
    141144 * unpredictable. 
    142145 * 
     146 * random_input_words() just provides a raw block of entropy to the input 
     147 * pool, such as from a hardware entropy generator. 
     148 * 
     149 * random_input_wait() suspends the caller until such time as the 
     150 * entropy pool falls below the write threshold, and returns a count of how 
     151 * much entropy (in bits) is needed to sustain the pool. 
     152 * 
    143153 * All of these routines try to estimate how many bits of randomness a 
    144154 * particular randomness source.  They do this by keeping track of the 
    145155 * first and second order deltas of the event timings. 
    void add_disk_randomness(struct gendisk  
    715725} 
    716726#endif 
    717727 
     728/* 
     729 * random_input_words - add bulk entropy to pool 
     730 * 
     731 * @buf: buffer to add 
     732 * @wordcount: number of __u32 words to add 
     733 * @ent_count: total amount of entropy (in bits) to credit 
     734 * 
     735 * this provides bulk input of entropy to the input pool 
     736 * 
     737 */ 
     738void random_input_words(__u32 *buf, size_t wordcount, int ent_count) 
     739{ 
     740        mix_pool_bytes(&input_pool, buf, wordcount*4); 
     741 
     742        credit_entropy_bits(&input_pool, ent_count); 
     743 
     744        DEBUG_ENT("crediting %d bits => %d\n", 
     745                  ent_count, input_pool.entropy_count); 
     746        /* 
     747         * Wake up waiting processes if we have enough 
     748         * entropy. 
     749         */ 
     750        if (input_pool.entropy_count >= random_read_wakeup_thresh) 
     751                wake_up_interruptible(&random_read_wait); 
     752} 
     753EXPORT_SYMBOL(random_input_words); 
     754 
     755/* 
     756 * random_input_wait - wait until random needs entropy 
     757 * 
     758 * this function sleeps until the /dev/random subsystem actually 
     759 * needs more entropy, and then return the amount of entropy 
     760 * that it would be nice to have added to the system. 
     761 */ 
     762int random_input_wait(void) 
     763{ 
     764        int count; 
     765 
     766        wait_event_interruptible(random_write_wait, 
     767                input_pool.entropy_count < random_write_wakeup_thresh); 
     768 
     769        count = random_write_wakeup_thresh - input_pool.entropy_count; 
     770 
     771        /* likely we got woken up due to a signal */ 
     772        if (count <= 0) count = random_read_wakeup_thresh; 
     773 
     774        DEBUG_ENT("requesting %d bits from input_wait()er %d<%d\n", 
     775                count, 
     776                input_pool.entropy_count, random_write_wakeup_thresh); 
     777 
     778        return count; 
     779} 
     780EXPORT_SYMBOL(random_input_wait); 
     781 
     782 
    718783/********************************************************************* 
    719784 * 
    720785 * Entropy extraction routines 
  • fs/fcntl.c

    a b SYSCALL_DEFINE1(dup, unsigned int, filde 
    142142        } 
    143143        return ret; 
    144144} 
     145EXPORT_SYMBOL(sys_dup); 
    145146 
    146147#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME) 
    147148 
  • include/linux/miscdevice.h

    a b  
    1818#define APOLLO_MOUSE_MINOR      7 
    1919#define PC110PAD_MINOR          9 
    2020/*#define ADB_MOUSE_MINOR       10      FIXME OBSOLETE */ 
     21#define CRYPTODEV_MINOR         70      /* /dev/crypto */ 
    2122#define WATCHDOG_MINOR          130     /* Watchdog timer     */ 
    2223#define TEMP_MINOR              131     /* Temperature Sensor */ 
    2324#define RTC_MINOR               135 
  • include/linux/random.h

    a b  
    99 
    1010#include <linux/types.h> 
    1111#include <linux/ioctl.h> 
     12#include <linux/types.h> /* for __u32 in user space */ 
    1213#include <linux/irqnr.h> 
    1314 
    1415/* ioctl()'s for the random number generator */ 
     
    3435/* Clear the entropy pool and associated counters.  (Superuser only.) */ 
    3536#define RNDCLEARPOOL    _IO( 'R', 0x06 ) 
    3637 
     38#ifdef CONFIG_FIPS_RNG 
     39 
     40/* Size of seed value - equal to AES blocksize */ 
     41#define AES_BLOCK_SIZE_BYTES    16 
     42#define SEED_SIZE_BYTES                 AES_BLOCK_SIZE_BYTES 
     43/* Size of AES key */ 
     44#define KEY_SIZE_BYTES          16 
     45 
     46/* ioctl() structure used by FIPS 140-2 Tests */ 
     47struct rand_fips_test { 
     48        unsigned char key[KEY_SIZE_BYTES];                      /* Input */ 
     49        unsigned char datetime[SEED_SIZE_BYTES];        /* Input */ 
     50        unsigned char seed[SEED_SIZE_BYTES];            /* Input */ 
     51        unsigned char result[SEED_SIZE_BYTES];          /* Output */ 
     52}; 
     53 
     54/* FIPS 140-2 RNG Variable Seed Test. (Superuser only.) */ 
     55#define RNDFIPSVST      _IOWR('R', 0x10, struct rand_fips_test) 
     56 
     57/* FIPS 140-2 RNG Monte Carlo Test. (Superuser only.) */ 
     58#define RNDFIPSMCT      _IOWR('R', 0x11, struct rand_fips_test) 
     59 
     60#endif /* #ifdef CONFIG_FIPS_RNG */ 
     61 
    3762struct rand_pool_info { 
    3863        int     entropy_count; 
    3964        int     buf_size; 
    extern void add_input_randomness(unsigne 
    5479                                 unsigned int value); 
    5580extern void add_interrupt_randomness(int irq); 
    5681 
     82extern void random_input_words(__u32 *buf, size_t wordcount, int ent_count); 
     83extern int random_input_wait(void); 
     84#define HAS_RANDOM_INPUT_WAIT 1 
     85 
    5786extern void get_random_bytes(void *buf, int nbytes); 
    5887void generate_random_uuid(unsigned char uuid_out[16]); 
    5988 
  • kernel/pid.c

    a b struct task_struct *find_task_by_vpid(pi 
    424424{ 
    425425        return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns); 
    426426} 
     427EXPORT_SYMBOL(find_task_by_vpid); 
    427428 
    428429struct pid *get_task_pid(struct task_struct *task, enum pid_type type) 
    429430{ 
Note: See TracBrowser for help on using the repository browser.