kernel/x86_64: Fix descriptor index off-by-one in assert.
This was apparently copied from GlobalDescriptorTable::SetTSS() which needs two table entries and therefore checks for index + 1. For the SetUserTLS case this isn't needed and would cause aborts when reaching the maximum CPU count (64 currently). Change-Id: I27bd777fedadbd3740ac8c791199ec9300b06327 Reviewed-on: https://review.haiku-os.org/809 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
44a1cfb8d8
commit
22ca923f71
@@ -280,7 +280,7 @@ unsigned
|
||||
GlobalDescriptorTable::SetUserTLS(unsigned cpu, uintptr_t base, size_t limit)
|
||||
{
|
||||
auto index = kFirstTSS + cpu * 3 + 2;
|
||||
ASSERT(index + 1 < kDescriptorCount);
|
||||
ASSERT(index < kDescriptorCount);
|
||||
UserTLSDescriptor desc(base, limit);
|
||||
fTable[index] = desc.GetDescriptor();
|
||||
return index;
|
||||
|
||||
Reference in New Issue
Block a user