/* This driver exposes a special register which can be used for fast synchronization across a large SMP machine. The hardware is exposed as an array of bytes where each process will write to one of the bytes to indicate it has finished the current stage and this update is broadcast to all processors without having to bounce a cacheline between them. In POWER5 and POWER6 there is one of these registers per SMP, but it is presented in two forms; first, it is given as a whole and then as a number of smaller registers which alias to parts of the single whole register. This can potentially allow multiple groups of processes to each have their own private synchronization device.
Note that this hardware *must* be written to using *only* single byte writes. It may be read using 1, 2, 4, or 8 byte loads which must be aligned since this region is treated as cache-inhibited processes should also use a full sync before and after writing to the BSR to ensure all stores and the BSR update have made it to all chips in the system
*/
/* This is arbitrary number, up to Power6 it's been 17 or fewer */ #define BSR_MAX_DEVS (32)
struct bsr_dev {
u64 bsr_addr; /* Real address */
u64 bsr_len; /* length of mem region we can map */ unsigned bsr_bytes; /* size of the BSR reg itself */ unsigned bsr_stride; /* interval at which BSR repeats in the page */ unsigned bsr_type; /* maps to enum below */ unsigned bsr_num; /* bsr id number for its type */ int bsr_minor;
/* check for the case of a small BSR device and map one 4k page for it*/ if (dev->bsr_len < PAGE_SIZE && size == PAGE_SIZE)
ret = remap_4k_pfn(vma, vma->vm_start, dev->bsr_addr >> 12,
vma->vm_page_prot); elseif (size <= dev->bsr_len)
ret = io_remap_pfn_range(vma, vma->vm_start,
dev->bsr_addr >> PAGE_SHIFT,
size, vma->vm_page_prot); else return -EINVAL;
/* if we have a bsr_len of > 4k and less then PAGE_SIZE (64k pages) */ /* we can only map 4k of it, so only advertise the 4k in sysfs */ if (cur->bsr_len > 4096 && cur->bsr_len < PAGE_SIZE)
cur->bsr_len = 4096;
switch(cur->bsr_bytes) { case 8:
cur->bsr_type = BSR_8; break; case 16:
cur->bsr_type = BSR_16; break; case 64:
cur->bsr_type = BSR_64; break; case 128:
cur->bsr_type = BSR_128; break; case 4096:
cur->bsr_type = BSR_4096; break; default:
cur->bsr_type = BSR_UNKNOWN;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.