github.com/ttpreport/gvisor-ligolo@v0.0.0-20240123134145-a858404967ba/pkg/sentry/loader/loader_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package loader
     4  
     5  import (
     6  	"github.com/ttpreport/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (v *VDSO) StateTypeName() string {
    10  	return "pkg/sentry/loader.VDSO"
    11  }
    12  
    13  func (v *VDSO) StateFields() []string {
    14  	return []string{
    15  		"ParamPage",
    16  		"vdso",
    17  		"os",
    18  		"arch",
    19  		"phdrs",
    20  	}
    21  }
    22  
    23  func (v *VDSO) beforeSave() {}
    24  
    25  // +checklocksignore
    26  func (v *VDSO) StateSave(stateSinkObject state.Sink) {
    27  	v.beforeSave()
    28  	var phdrsValue []elfProgHeader
    29  	phdrsValue = v.savePhdrs()
    30  	stateSinkObject.SaveValue(4, phdrsValue)
    31  	stateSinkObject.Save(0, &v.ParamPage)
    32  	stateSinkObject.Save(1, &v.vdso)
    33  	stateSinkObject.Save(2, &v.os)
    34  	stateSinkObject.Save(3, &v.arch)
    35  }
    36  
    37  func (v *VDSO) afterLoad() {}
    38  
    39  // +checklocksignore
    40  func (v *VDSO) StateLoad(stateSourceObject state.Source) {
    41  	stateSourceObject.Load(0, &v.ParamPage)
    42  	stateSourceObject.Load(1, &v.vdso)
    43  	stateSourceObject.Load(2, &v.os)
    44  	stateSourceObject.Load(3, &v.arch)
    45  	stateSourceObject.LoadValue(4, new([]elfProgHeader), func(y any) { v.loadPhdrs(y.([]elfProgHeader)) })
    46  }
    47  
    48  func (e *elfProgHeader) StateTypeName() string {
    49  	return "pkg/sentry/loader.elfProgHeader"
    50  }
    51  
    52  func (e *elfProgHeader) StateFields() []string {
    53  	return []string{
    54  		"Type",
    55  		"Flags",
    56  		"Off",
    57  		"Vaddr",
    58  		"Paddr",
    59  		"Filesz",
    60  		"Memsz",
    61  		"Align",
    62  	}
    63  }
    64  
    65  func (e *elfProgHeader) beforeSave() {}
    66  
    67  // +checklocksignore
    68  func (e *elfProgHeader) StateSave(stateSinkObject state.Sink) {
    69  	e.beforeSave()
    70  	stateSinkObject.Save(0, &e.Type)
    71  	stateSinkObject.Save(1, &e.Flags)
    72  	stateSinkObject.Save(2, &e.Off)
    73  	stateSinkObject.Save(3, &e.Vaddr)
    74  	stateSinkObject.Save(4, &e.Paddr)
    75  	stateSinkObject.Save(5, &e.Filesz)
    76  	stateSinkObject.Save(6, &e.Memsz)
    77  	stateSinkObject.Save(7, &e.Align)
    78  }
    79  
    80  func (e *elfProgHeader) afterLoad() {}
    81  
    82  // +checklocksignore
    83  func (e *elfProgHeader) StateLoad(stateSourceObject state.Source) {
    84  	stateSourceObject.Load(0, &e.Type)
    85  	stateSourceObject.Load(1, &e.Flags)
    86  	stateSourceObject.Load(2, &e.Off)
    87  	stateSourceObject.Load(3, &e.Vaddr)
    88  	stateSourceObject.Load(4, &e.Paddr)
    89  	stateSourceObject.Load(5, &e.Filesz)
    90  	stateSourceObject.Load(6, &e.Memsz)
    91  	stateSourceObject.Load(7, &e.Align)
    92  }
    93  
    94  func init() {
    95  	state.Register((*VDSO)(nil))
    96  	state.Register((*elfProgHeader)(nil))
    97  }