github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/syscalls/linux/linux_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package linux
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (f *futexWaitRestartBlock) StateTypeName() string {
    12  	return "pkg/sentry/syscalls/linux.futexWaitRestartBlock"
    13  }
    14  
    15  func (f *futexWaitRestartBlock) StateFields() []string {
    16  	return []string{
    17  		"duration",
    18  		"addr",
    19  		"private",
    20  		"val",
    21  		"mask",
    22  	}
    23  }
    24  
    25  func (f *futexWaitRestartBlock) beforeSave() {}
    26  
    27  // +checklocksignore
    28  func (f *futexWaitRestartBlock) StateSave(stateSinkObject state.Sink) {
    29  	f.beforeSave()
    30  	stateSinkObject.Save(0, &f.duration)
    31  	stateSinkObject.Save(1, &f.addr)
    32  	stateSinkObject.Save(2, &f.private)
    33  	stateSinkObject.Save(3, &f.val)
    34  	stateSinkObject.Save(4, &f.mask)
    35  }
    36  
    37  func (f *futexWaitRestartBlock) afterLoad(context.Context) {}
    38  
    39  // +checklocksignore
    40  func (f *futexWaitRestartBlock) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    41  	stateSourceObject.Load(0, &f.duration)
    42  	stateSourceObject.Load(1, &f.addr)
    43  	stateSourceObject.Load(2, &f.private)
    44  	stateSourceObject.Load(3, &f.val)
    45  	stateSourceObject.Load(4, &f.mask)
    46  }
    47  
    48  func (p *pollRestartBlock) StateTypeName() string {
    49  	return "pkg/sentry/syscalls/linux.pollRestartBlock"
    50  }
    51  
    52  func (p *pollRestartBlock) StateFields() []string {
    53  	return []string{
    54  		"pfdAddr",
    55  		"nfds",
    56  		"timeout",
    57  	}
    58  }
    59  
    60  func (p *pollRestartBlock) beforeSave() {}
    61  
    62  // +checklocksignore
    63  func (p *pollRestartBlock) StateSave(stateSinkObject state.Sink) {
    64  	p.beforeSave()
    65  	stateSinkObject.Save(0, &p.pfdAddr)
    66  	stateSinkObject.Save(1, &p.nfds)
    67  	stateSinkObject.Save(2, &p.timeout)
    68  }
    69  
    70  func (p *pollRestartBlock) afterLoad(context.Context) {}
    71  
    72  // +checklocksignore
    73  func (p *pollRestartBlock) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    74  	stateSourceObject.Load(0, &p.pfdAddr)
    75  	stateSourceObject.Load(1, &p.nfds)
    76  	stateSourceObject.Load(2, &p.timeout)
    77  }
    78  
    79  func (n *clockNanosleepRestartBlock) StateTypeName() string {
    80  	return "pkg/sentry/syscalls/linux.clockNanosleepRestartBlock"
    81  }
    82  
    83  func (n *clockNanosleepRestartBlock) StateFields() []string {
    84  	return []string{
    85  		"c",
    86  		"end",
    87  		"rem",
    88  	}
    89  }
    90  
    91  func (n *clockNanosleepRestartBlock) beforeSave() {}
    92  
    93  // +checklocksignore
    94  func (n *clockNanosleepRestartBlock) StateSave(stateSinkObject state.Sink) {
    95  	n.beforeSave()
    96  	stateSinkObject.Save(0, &n.c)
    97  	stateSinkObject.Save(1, &n.end)
    98  	stateSinkObject.Save(2, &n.rem)
    99  }
   100  
   101  func (n *clockNanosleepRestartBlock) afterLoad(context.Context) {}
   102  
   103  // +checklocksignore
   104  func (n *clockNanosleepRestartBlock) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   105  	stateSourceObject.Load(0, &n.c)
   106  	stateSourceObject.Load(1, &n.end)
   107  	stateSourceObject.Load(2, &n.rem)
   108  }
   109  
   110  func init() {
   111  	state.Register((*futexWaitRestartBlock)(nil))
   112  	state.Register((*pollRestartBlock)(nil))
   113  	state.Register((*clockNanosleepRestartBlock)(nil))
   114  }