Lines Matching refs:uword

104 #define UWORDS_PER_PAGE	(BYTES_PER_PAGE/sizeof(uword))
116 uword *start_of_stacks, /* only for mapped stacks, otherwise 0 */
303 adjust_stacks(struct stack_struct *descr, uword *lower_max, uword *upper_max, uword *partition_hint)
305 register uword diff;
308 if (diff = (uword) lower_max % STACK_PAGESIZE)
309 lower_max += (STACK_PAGESIZE - diff)/sizeof(uword);
312 ((uword) upper_max % STACK_PAGESIZE)/sizeof(uword);
325 ((uword) partition_hint % STACK_PAGESIZE)/sizeof(uword);
399 alloc_stack_pairs(int nstacks, char **names, uword *bytes, struct stack_struct **descr)
401 uword bytes_allocated = 0;
403 uword *stack_base;
419 stack_base = (uword *) VirtualAlloc(NULL,bytes_allocated,MEM_RESERVE,
425 stack_base = (uword *) mmap((caddr_t) 0,(size_t) bytes_allocated,
437 if (stack_base == (uword *) -1)
448 stack_base = (uword *) VirtualAlloc(NULL,bytes_allocated,MEM_COMMIT,
454 stack_base = (uword *) mmap((caddr_t) 0,(size_t) bytes_allocated,
463 stack_base = (uword *) sbrk(bytes_allocated);
465 if (stack_base == (uword *) -1)
476 end_of_stacks += bytes_allocated / sizeof(uword);
477 if ((uword) stack_base % STACK_PAGESIZE)
489 stack_base += bytes[i]/sizeof(uword);
498 uword bytes = (char*) upper[1].start - (char*) addr;
529 * mixed size objects (in units of uword). An object that is pushed
554 _stack_init(struct stack_header *down, struct stack_header *up, uword words_needed)
560 words_needed*sizeof(uword) + sizeof(struct stack_header),
563 stack->top = stack->limit = (uword *) stack + bytes_allocated/sizeof(word);
570 stack_create(struct stack_header **pstack, uword words_needed)
583 stack_push(register struct stack_header **pstack, uword words_needed)
589 if (stack->top < (uword *)(stack + 1))
603 stack_pop_to(register struct stack_header **pstack, uword *old_top)
607 while (old_top < (uword *)(stack + 1) || stack->limit <= old_top)
613 stack_pop(register struct stack_header **pstack, uword word_offset)
644 (stack->limit - (uword *) stack)/UWORDS_PER_PAGE);
657 _temp_init(struct temp_header *first, struct temp_header *next, uword bytes_needed)
674 temp_create(struct temp_header **ptemp, uword bytes_needed)
681 temp_alloc(struct temp_header **ptemp, uword bytes_needed)
706 temp_align(struct temp_header **ptemp, uword size)
708 uword mod = (uword)(*ptemp)->top % size;
739 * Memory is in units of uword.
744 * register uword *rd, *wr; ... a read and a write pointer.
784 uword words_needed, int *is_nonpage_buffer)
790 bytes_allocated = words_needed*sizeof(uword) + sizeof(struct buffer_block_header);
795 words_needed*sizeof(uword) + sizeof(struct buffer_block_header),
801 block->top = (uword *) (block + 1);
802 block->limit = (uword *) block + bytes_allocated/sizeof(uword);
804 ((uword) block & (BYTES_PER_PAGE-1)) /* not page-aligned */
810 buffer_create(unbounded_buffer *bd, uword minwords)
825 bd->write_block->top = (uword *) (bd->write_block + 1);
828 uword *
829 buffer_alloc(unbounded_buffer *bd, uword *ptr, uword words)
842 if (block && (block->limit - (uword *) (block + 1) >= words))
845 block->top = (uword *) (block + 1); /* reinit */
860 uword *
861 buffer_next(unbounded_buffer *bd, uword *ptr)
870 ptr = (uword *)(bd->read_block + 1);
876 buffer_setread(unbounded_buffer *bd, uword *ptr)
883 while (block && (ptr < (uword *)(block + 1) || block->limit < ptr))
889 block = (struct buffer_block_header *) ((uword) ptr & ~(BYTES_PER_PAGE-1));
912 hp_free((uword *) this);
916 (this->limit - (uword *) this)/UWORDS_PER_PAGE);
921 bd->write_block_end = (uword *) 0;
924 uword
925 buffer_pos(unbounded_buffer *bd, uword *ptr)
928 register uword length = 0;
929 while (/* block && */ (ptr < (uword *)(block + 1) || block->limit < ptr))
931 length += block->top - (uword *)(block + 1);
934 return length + (ptr - (uword *)(block + 1));
1125 if (offset = (uword) s % map_alignment)
1184 if (offset = (uword) start_private_area % map_alignment)
1215 end_of_stacks = start_of_stacks = (uword *) start_stack_area;
1230 end_of_stacks = start_of_stacks = (uword *) 0;