Add reference to frame. * * Find respective frame structure for supplied PFN and * increment frame reference count. * * @param pfn Frame number of the frame to be freed. * */
| 1067 | * |
| 1068 | */ |
| 1069 | _NO_TRACE void frame_reference_add(pfn_t pfn) |
| 1070 | { |
| 1071 | irq_spinlock_lock(&zones.lock, true); |
| 1072 | |
| 1073 | /* |
| 1074 | * First, find host frame zone for addr. |
| 1075 | */ |
| 1076 | size_t znum = find_zone(pfn, 1, 0); |
| 1077 | |
| 1078 | assert(znum != (size_t) -1); |
| 1079 | |
| 1080 | zones.info[znum].frames[pfn - zones.info[znum].base].refcount++; |
| 1081 | |
| 1082 | irq_spinlock_unlock(&zones.lock, true); |
| 1083 | } |
| 1084 | |
| 1085 | /** Mark given range unavailable in frame zones. |
| 1086 | * |
no test coverage detected