Home | History | Annotate | Download | only in arm

Lines Matching refs:table

582 /* Total number of trampolines that fit in one trampoline table */
591 table = NULL;
594 while (table == NULL) {
605 /* Now drop the second half of the allocation to make room for the trampoline table */
613 /* Remap the trampoline table to directly follow the config page */
631 table = calloc (1, sizeof(ffi_trampoline_table));
632 table->free_count = FFI_TRAMPOLINE_COUNT;
633 table->config_page = config_page;
634 table->trampoline_page = trampoline_page;
637 table->free_list_pool = calloc(FFI_TRAMPOLINE_COUNT, sizeof(ffi_trampoline_table_entry));
640 for (i = 0; i < table->free_count; i++) {
641 ffi_trampoline_table_entry *entry = &table->free_list_pool[i];
642 entry->trampoline = (void *) (table->trampoline_page + (i * FFI_TRAMPOLINE_SIZE));
644 if (i < table->free_count - 1)
645 entry->next = &table->free_list_pool[i+1];
648 table->free_list = table->free_list_pool;
651 return table;
664 /* Check for an active trampoline table with available entries. */
665 ffi_trampoline_table *table = ffi_trampoline_tables;
666 if (table == NULL || table->free_list == NULL) {
667 table = ffi_trampoline_table_alloc ();
668 if (table == NULL) {
673 /* Insert the new table at the top of the list */
674 table->next = ffi_trampoline_tables;
675 if (table->next != NULL)
676 table->next->prev = table;
678 ffi_trampoline_tables = table;
691 closure->trampoline_table = table;
704 /* Fetch the table and entry references */
705 ffi_trampoline_table *table = closure->trampoline_table;
709 entry->next = table->free_list;
710 table->free_list = entry;
711 table->free_count++;
713 /* If all trampolines within this table are free, and at least one other table exists, deallocate
714 * the table */
715 if (table->free_count == FFI_TRAMPOLINE_COUNT && ffi_trampoline_tables != table) {
717 if (table->prev != NULL)
718 table->prev->next = table->next;
720 if (table->next != NULL)
721 table->next->prev = table->prev;
725 kt = vm_deallocate (mach_task_self (), table->config_page, PAGE_SIZE);
729 kt = vm_deallocate (mach_task_self (), table->trampoline_page, PAGE_SIZE);
734 free (table->free_list_pool);
735 free (table);
736 } else if (ffi_trampoline_tables != table) {
737 /* Otherwise, bump this table to the top of the list */
738 table->prev = NULL;
739 table->next = ffi_trampoline_tables;
741 ffi_trampoline_tables->prev = table;
743 ffi_trampoline_tables = table;