You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: seg_amd64.go
    path of file: ./repos/eggos/kernel
    
    the code of the file until where you have to start completion: package kernel

import (
	"unsafe"

	"github.com/icexin/eggos/kernel/sys"
)

const (
	segDplKernel = 0x00
	segDplUser   = 0x60
)

const (
	_KCODE_IDX = 1
	_KDATA_IDX = 2
	_UCODE_IDX = 3
	_UDATA_IDX = 4
	_TSS
    
func setTssDesc(lo, hi *gdtSegDesc, addr, limit uintptr) {
	// tss limit 0-15
	lo[0] = byte(limit)
	lo[1] = byte(limit >> 8)
	// tss base 0-15
	lo[2] = byte(addr)
	lo[3] = byte(addr >> 8)
	// tss base 16-23
	lo[4] = byte(addr >> 16)
	// type 64 bit tss, P=1
	lo[5] = 0x89
	// limit 16-19 and AVL=1
	lo[6] = 0x80 | byte(limit>>16)&0x07
	// base addr 24-31 G=0
	lo[7] = byte(addr >> 24)

	// base addr 32-63
	*(*uint32)(unsafe.Pointer(hi)) = uint32(addr >> 32)
}