#include #include #include #include #include "rnd.h" #include "die.h" #include "ioexact.h" #include "ioops.h" static int fdw = -1; static void randombytes_weak(unsigned char *x, size_t xlen) { int ret; if (fdw == -1) { for (;;) { fdw = open(LOW_ENTROPY_SOURCE, O_RDONLY); if (fdw != -1) break; sleep(1); } } while (xlen > 0) { if (xlen < 1048576) ret = xlen; else ret = 1048576; ret = read(fdw, x, ret); if (ret < 1) { sleep(1); continue; } x += ret; xlen -= ret; } } static void randombytes_strong(unsigned char *x, size_t xlen) { int fds, ret; fds = open_or_die(HIG_ENTROPY_SOURCE, O_RDONLY); ret = read_exact(fds, x, xlen, 0); if (ret != (int) xlen) panic("Error reading from entropy source!\n"); close(fds); } int secrand(void) { int ret; randombytes_weak((void *) &ret, sizeof(ret)); return ret; } void gen_key_bytes(unsigned char *area, size_t len) { randombytes_strong(area, len); } ame='h' onchange='this.form.submit();'> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2016-01-29 11:29:32 +0000
committerBjorn Helgaas <bhelgaas@google.com>2016-02-09 12:38:52 -0600
commited00c83cd4909dc268cc0639bf16804444ed8c79 (patch)
tree3eac0bd2b812e57ae647ffb7111e7afc1f74fe51 /Documentation
parentdd193929d91e1b44b90f81509feeff10c94ddc4d (diff)
PCI: designware: Remove PCI_PROBE_ONLY handling
The PCIe designware host driver is not used in system configurations requiring the PCI_PROBE_ONLY flag to be set to prevent resources assignment, therefore the driver code handling the flag can be removed from the kernel. Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Pratyush Anand <pratyush.anand@gmail.com> Acked-by: Jingoo Han Jingoo Han <jingoohan1@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com> Cc: Zhou Wang <wangzhou1@hisilicon.com>
Diffstat (limited to 'Documentation')