source: trunk/target/linux/generic/patches-2.6.31/971-ocf_20100325.patch @ 21952

Last change on this file since 21952 was 21952, checked in by nbd, 6 years ago

rename target/linux/generic-2.6 to generic

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  
    712722} 
    713723#endif 
    714724 
     725/* 
     726 * random_input_words - add bulk entropy to pool 
     727 * 
     728 * @buf: buffer to add 
     729 * @wordcount: number of __u32 words to add 
     730 * @ent_count: total amount of entropy (in bits) to credit 
     731 * 
     732 * this provides bulk input of entropy to the input pool 
     733 * 
     734 */ 
     735void random_input_words(__u32 *buf, size_t wordcount, int ent_count) 
     736{ 
     737        mix_pool_bytes(&input_pool, buf, wordcount*4); 
     738 
     739        credit_entropy_bits(&input_pool, ent_count); 
     740 
     741        DEBUG_ENT("crediting %d bits => %d\n", 
     742                  ent_count, input_pool.entropy_count); 
     743        /* 
     744         * Wake up waiting processes if we have enough 
     745         * entropy. 
     746         */ 
     747        if (input_pool.entropy_count >= random_read_wakeup_thresh) 
     748                wake_up_interruptible(&random_read_wait); 
     749} 
     750EXPORT_SYMBOL(random_input_words); 
     751 
     752/* 
     753 * random_input_wait - wait until random needs entropy 
     754 * 
     755 * this function sleeps until the /dev/random subsystem actually 
     756 * needs more entropy, and then return the amount of entropy 
     757 * that it would be nice to have added to the system. 
     758 */ 
     759int random_input_wait(void) 
     760{ 
     761        int count; 
     762 
     763        wait_event_interruptible(random_write_wait,  
     764                         input_pool.entropy_count < random_write_wakeup_thresh); 
     765 
     766        count = random_write_wakeup_thresh - input_pool.entropy_count; 
     767 
     768        /* likely we got woken up due to a signal */ 
     769        if (count <= 0) count = random_read_wakeup_thresh;  
     770 
     771        DEBUG_ENT("requesting %d bits from input_wait()er %d<%d\n", 
     772                  count, 
     773                  input_pool.entropy_count, random_write_wakeup_thresh); 
     774 
     775        return count; 
     776} 
     777EXPORT_SYMBOL(random_input_wait); 
     778 
     779 
    715780#define EXTRACT_SIZE 10 
    716781 
    717782/********************************************************************* 
  • fs/fcntl.c

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

    a b  
    1212#define APOLLO_MOUSE_MINOR      7 
    1313#define PC110PAD_MINOR          9 
    1414/*#define ADB_MOUSE_MINOR       10      FIXME OBSOLETE */ 
     15#define CRYPTODEV_MINOR         70      /* /dev/crypto */ 
    1516#define WATCHDOG_MINOR          130     /* Watchdog timer     */ 
    1617#define TEMP_MINOR              131     /* Temperature Sensor */ 
    1718#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 
    5075                                 unsigned int value); 
    5176extern void add_interrupt_randomness(int irq); 
    5277 
     78extern void random_input_words(__u32 *buf, size_t wordcount, int ent_count); 
     79extern int random_input_wait(void); 
     80#define HAS_RANDOM_INPUT_WAIT 1 
     81 
    5382extern void get_random_bytes(void *buf, int nbytes); 
    5483void generate_random_uuid(unsigned char uuid_out[16]); 
    5584 
  • kernel/pid.c

    a b struct task_struct *find_task_by_vpid(pi 
    387387{ 
    388388        return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns); 
    389389} 
     390EXPORT_SYMBOL(find_task_by_vpid); 
    390391 
    391392struct pid *get_task_pid(struct task_struct *task, enum pid_type type) 
    392393{ 
Note: See TracBrowser for help on using the repository browser.