search for: getpagesize

Displaying 20 results from an estimated 324 matches for "getpagesize".

2017 Oct 30
2
[PATCH] openbsd-compat/bsd-getpagesize.c: include includes.h for config.h defines
The configure script checks for getpagesize() and sets HAVE_GETPAGESIZE in config.h, but bsd-getpagesize.c forgot to include includes.h (which indirectly includes config.h) so the checks always fails, causing linker issues when linking statically on systems with getpagesize(): http://autobuild.buildroot.net/results/8cc/8cc30818a400c7a392a3d...
2004 Jan 24
2
mmap and getpagesize
The man page for mmap() says the size needs to be a multiple of getpagesize(). So in my code I call getpagesize() and adjust my lengths accordingly. klibc doesn't have getpagesize() implemented. Is it safe to call mmap() with arbritary lengths and assume the mmap will round up for you? Does this work on glibc too? If so, I can just eliminate my getpagesize() code. It...
2004 Jul 15
2
getpagesize / libsysfs broken with 0.148
Hi all, the implementation of getpagesize() is broken in klibc. klibc uses sysinfo.mem_unit, which linux interpretes as the memory unit all other memory values returned are to be multiplied with. So it's perfectly ok for the linux sysinfo() to return a mem_unit of '1', which is does if the memory available for this machine f...
2008 Jul 29
2
syconf(_SC_PAGESIZE) versus getpagesize()
hello karel, thanks a lot for the klibc portability merges. current HEAD klibc failure: mkswap.c: In function ?init_signature_page?: mkswap.c:148: error: ?_SC_PAGESIZE? undeclared (first use in this function) although POSIX encourages sysconf() could util-linux use getpagesize() ? -- maks
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...: + case 'g': + ret <<= 10; + case 'M': + case 'm': + ret <<= 10; + case 'K': + case 'k': + ret <<= 10; + end++; + default: + break; + } + return ret; +} + +static inline unsigned long page_align(unsigned long addr) +{ + return ((addr + getpagesize()-1) & ~(getpagesize()-1)); +} + +/* initrd gets loaded at top of memory: return length. */ +static unsigned long load_initrd(const char *name, unsigned long end) +{ + int ifd; + struct stat st; + void *iaddr; + + if (!name) + return 0; + + ifd = open(name, O_RDONLY, 0); + if (ifd < 0) + e...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...: + case 'g': + ret <<= 10; + case 'M': + case 'm': + ret <<= 10; + case 'K': + case 'k': + ret <<= 10; + end++; + default: + break; + } + return ret; +} + +static inline unsigned long page_align(unsigned long addr) +{ + return ((addr + getpagesize()-1) & ~(getpagesize()-1)); +} + +/* initrd gets loaded at top of memory: return length. */ +static unsigned long load_initrd(const char *name, unsigned long end) +{ + int ifd; + struct stat st; + void *iaddr; + + if (!name) + return 0; + + ifd = open(name, O_RDONLY, 0); + if (ifd < 0) + e...
2007 Jul 20
2
[PATCH] Remove -static from Documentation/lguest/Makefile
...ds; int max_infd; + struct lguest_device_desc *descs; struct device *dev; struct device **lastdev; }; @@ -324,8 +326,7 @@ static int tell_kernel(u32 pgdir, u32 st static int tell_kernel(u32 pgdir, u32 start, u32 page_offset) { u32 args[] = { LHREQ_INITIALIZE, - LGUEST_GUEST_TOP/getpagesize(), /* Just below us */ - pgdir, start, page_offset }; + top/getpagesize(), pgdir, start, page_offset }; int fd; fd = open_or_die("/dev/lguest", O_RDWR); @@ -382,7 +383,7 @@ static void *_check_pointer(unsigned lon static void *_check_pointer(unsigned long addr, unsi...
2007 Jul 20
2
[PATCH] Remove -static from Documentation/lguest/Makefile
...ds; int max_infd; + struct lguest_device_desc *descs; struct device *dev; struct device **lastdev; }; @@ -324,8 +326,7 @@ static int tell_kernel(u32 pgdir, u32 st static int tell_kernel(u32 pgdir, u32 start, u32 page_offset) { u32 args[] = { LHREQ_INITIALIZE, - LGUEST_GUEST_TOP/getpagesize(), /* Just below us */ - pgdir, start, page_offset }; + top/getpagesize(), pgdir, start, page_offset }; int fd; fd = open_or_die("/dev/lguest", O_RDWR); @@ -382,7 +383,7 @@ static void *_check_pointer(unsigned lon static void *_check_pointer(unsigned long addr, unsi...
2007 Nov 14
1
[PATCH] Remove pagesize parameter from vring_init/vring_size
...st.c b/Documentation/lguest/lguest.c index 4200839..171dead 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -34,6 +34,11 @@ #include <zlib.h> #include <assert.h> #include <sched.h> + +/* these are needed for virtio_ring.h */ +#define PAGE_SIZE (getpagesize()) +#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) + #include "linux/lguest_launcher.h" #include "linux/virtio_config.h" #include "linux/virtio_net.h" @@ -1036,7 +1041,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_de...
2007 Nov 14
1
[PATCH] Remove pagesize parameter from vring_init/vring_size
...st.c b/Documentation/lguest/lguest.c index 4200839..171dead 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -34,6 +34,11 @@ #include <zlib.h> #include <assert.h> #include <sched.h> + +/* these are needed for virtio_ring.h */ +#define PAGE_SIZE (getpagesize()) +#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) + #include "linux/lguest_launcher.h" #include "linux/virtio_config.h" #include "linux/virtio_net.h" @@ -1036,7 +1041,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_de...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...fd = open(name, flags); + if (fd < 0) + err(1, "Failed to open %s", name); + return fd; +} + +static void *map_zeroed_pages(unsigned long addr, unsigned int num) +{ + static int fd = -1; + + if (fd == -1) + fd = open_or_die("/dev/zero", O_RDONLY); + + if (mmap((void *)addr, getpagesize() * num, + PROT_READ|PROT_WRITE|PROT_EXEC, MAP_FIXED|MAP_PRIVATE, fd, 0) + != (void *)addr) + err(1, "Mmaping %u pages of /dev/zero @%p", num, (void *)addr); + return (void *)addr; +} + +/* Find magic string marking entry point, return entry point. */ +static unsigned long entry_po...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...fd = open(name, flags); + if (fd < 0) + err(1, "Failed to open %s", name); + return fd; +} + +static void *map_zeroed_pages(unsigned long addr, unsigned int num) +{ + static int fd = -1; + + if (fd == -1) + fd = open_or_die("/dev/zero", O_RDONLY); + + if (mmap((void *)addr, getpagesize() * num, + PROT_READ|PROT_WRITE|PROT_EXEC, MAP_FIXED|MAP_PRIVATE, fd, 0) + != (void *)addr) + err(1, "Mmaping %u pages of /dev/zero @%p", num, (void *)addr); + return (void *)addr; +} + +/* Find magic string marking entry point, return entry point. */ +static unsigned long entry_po...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...d long mem, unsigned long *page_offset, + const char *initrd, unsigned long *ird_size) { u32 *pgdir = NULL, *linear = NULL; int i, pte_pages; @@ -169,7 +180,7 @@ static u32 finish(unsigned long mem, uns /* Now set up pgd so that this memory is at page_offset */ for (i = 0; i < mem / getpagesize(); i += getpagesize()/sizeof(u32)) { pgdir[(i + *page_offset/getpagesize())/1024] - = (((u32)linear + i*sizeof(u32)) | PAGE_PRESENT); + = (((u32)(long)linear + i*sizeof(u32)) | PAGE_PRESENT); verbose("Top level %lu = %#08x\n", (i + *page_offset/getpagesize())/1024, pgdir...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...d long mem, unsigned long *page_offset, + const char *initrd, unsigned long *ird_size) { u32 *pgdir = NULL, *linear = NULL; int i, pte_pages; @@ -169,7 +180,7 @@ static u32 finish(unsigned long mem, uns /* Now set up pgd so that this memory is at page_offset */ for (i = 0; i < mem / getpagesize(); i += getpagesize()/sizeof(u32)) { pgdir[(i + *page_offset/getpagesize())/1024] - = (((u32)linear + i*sizeof(u32)) | PAGE_PRESENT); + = (((u32)(long)linear + i*sizeof(u32)) | PAGE_PRESENT); verbose("Top level %lu = %#08x\n", (i + *page_offset/getpagesize())/1024, pgdir...
2009 Jul 14
4
error on solaris please help interlocked*functions
...edep makedep.o > ../tools/makedep -C. -S.. -T.. -I/usr/include/freetype2 fnt2bdf.c fnt2fon.c make_ctests.c makedep.c relpath.c sfnt2fnt.c > `makedep' is up to date. > ../../tools/makedep -C. -S../.. -T../.. ffs.c fstatvfs.c futimes.c getopt.c getopt1.c getpagesize.c gettid.c interlocked.c isinf.c isnan.c lstat.c memcpy_unaligned.c memmove.c mkstemps.c poll.c pread.c pwrite.c readlink.c spawn.c statvfs.c strcasecmp.c strerror.c strncasecmp.c symlink.c usleep.c > cc -c -I. -I. -I../../include -I../../include -D__WIN...
2012 Dec 13
3
[PATCH] xenconsoled: use grant references instead of map_foreign_range
...onst char *dir, ...) va_end(ap); return ret; } + +static void domain_unmap_interface(struct domain *dom) +{ + if (dom->interface == NULL) + return; + if (xcg_handle && dom->ring_ref == -1) + xc_gnttab_munmap(xcg_handle, dom->interface, 1); + else + munmap(dom->interface, getpagesize()); + dom->interface = NULL; +} static int domain_create_ring(struct domain *dom) { @@ -522,9 +535,19 @@ static int domain_create_ring(struct domain *dom) } free(type); - if (ring_ref != dom->ring_ref) { - if (dom->interface != NULL) - munmap(dom->interface, getpagesize())...
2009 Jan 16
0
[LLVMdev] cygwin mmap problem
...=/dev/random of=x.bc 1+0 records in 1+0 records out 1105920 bytes (1.1 MB) copied, 0.167 s, 6.6 MB/s $ llc x.bc 17418 [main] llc 3596 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack) Segmentation fault (core dumped) The problem is that MemoryBuffer::getFile() uses getpagesize() to determine whether it's OK to mmap() a file, but on cygwin mmap() doesn't really obey the page size returned by getpagesize(). In my local LLVM tree I've worked around this in sys::Process::getPageSize(), returning a hard-coded value of 4096 instead of calling getpagesize(). (Maybe...
2007 Jun 28
1
Lguest
...on setup_pagetables(), on file Documentation/lguest.c ) /* Ideally we map all physical memory starting at page_offset. * However, if page_offset is 0xC0000000 we can only map 1G of physical * (0xC0000000 + 1G overflows). */ if (mem > -page_offset) mapped_pages =3D mem/getpagesize(); else mapped_pages =3D -page_offset/getpagesize(); Cheers Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.linux-foundation.org/pipermail/virtualization/attachments= /20070628/64303fe8/attachment.htm
2007 Jun 28
1
Lguest
...on setup_pagetables(), on file Documentation/lguest.c ) /* Ideally we map all physical memory starting at page_offset. * However, if page_offset is 0xC0000000 we can only map 1G of physical * (0xC0000000 + 1G overflows). */ if (mem > -page_offset) mapped_pages =3D mem/getpagesize(); else mapped_pages =3D -page_offset/getpagesize(); Cheers Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.linux-foundation.org/pipermail/virtualization/attachments= /20070628/64303fe8/attachment.htm
1999 Dec 09
1
solaris 2.5.1 still no good
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi folks, Here's what I get under solaris 2.5.1 (sparc) with gcc-2.95.2 and gnumake 3.78-something : bsd-snprintf.c: In function `msetup': bsd-snprintf.c:67: warning: implicit declaration of function `getpagesize' bsd-snprintf.c:72: `x' undeclared (first use in this function) bsd-snprintf.c:72: (Each undeclared identifier is reported only once bsd-snprintf.c:72: for each function it appears in.) bsd-snprintf.c:72: `y' undeclared (first use in this function) bsd-snprintf.c:72: warning: left-hand...