github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/kernel/msgqueue/msgqueue_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package msgqueue
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (l *msgList) StateTypeName() string {
    12  	return "pkg/sentry/kernel/msgqueue.msgList"
    13  }
    14  
    15  func (l *msgList) StateFields() []string {
    16  	return []string{
    17  		"head",
    18  		"tail",
    19  	}
    20  }
    21  
    22  func (l *msgList) beforeSave() {}
    23  
    24  // +checklocksignore
    25  func (l *msgList) StateSave(stateSinkObject state.Sink) {
    26  	l.beforeSave()
    27  	stateSinkObject.Save(0, &l.head)
    28  	stateSinkObject.Save(1, &l.tail)
    29  }
    30  
    31  func (l *msgList) afterLoad(context.Context) {}
    32  
    33  // +checklocksignore
    34  func (l *msgList) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    35  	stateSourceObject.Load(0, &l.head)
    36  	stateSourceObject.Load(1, &l.tail)
    37  }
    38  
    39  func (e *msgEntry) StateTypeName() string {
    40  	return "pkg/sentry/kernel/msgqueue.msgEntry"
    41  }
    42  
    43  func (e *msgEntry) StateFields() []string {
    44  	return []string{
    45  		"next",
    46  		"prev",
    47  	}
    48  }
    49  
    50  func (e *msgEntry) beforeSave() {}
    51  
    52  // +checklocksignore
    53  func (e *msgEntry) StateSave(stateSinkObject state.Sink) {
    54  	e.beforeSave()
    55  	stateSinkObject.Save(0, &e.next)
    56  	stateSinkObject.Save(1, &e.prev)
    57  }
    58  
    59  func (e *msgEntry) afterLoad(context.Context) {}
    60  
    61  // +checklocksignore
    62  func (e *msgEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    63  	stateSourceObject.Load(0, &e.next)
    64  	stateSourceObject.Load(1, &e.prev)
    65  }
    66  
    67  func (r *Registry) StateTypeName() string {
    68  	return "pkg/sentry/kernel/msgqueue.Registry"
    69  }
    70  
    71  func (r *Registry) StateFields() []string {
    72  	return []string{
    73  		"reg",
    74  	}
    75  }
    76  
    77  func (r *Registry) beforeSave() {}
    78  
    79  // +checklocksignore
    80  func (r *Registry) StateSave(stateSinkObject state.Sink) {
    81  	r.beforeSave()
    82  	stateSinkObject.Save(0, &r.reg)
    83  }
    84  
    85  func (r *Registry) afterLoad(context.Context) {}
    86  
    87  // +checklocksignore
    88  func (r *Registry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    89  	stateSourceObject.Load(0, &r.reg)
    90  }
    91  
    92  func (q *Queue) StateTypeName() string {
    93  	return "pkg/sentry/kernel/msgqueue.Queue"
    94  }
    95  
    96  func (q *Queue) StateFields() []string {
    97  	return []string{
    98  		"registry",
    99  		"dead",
   100  		"obj",
   101  		"senders",
   102  		"receivers",
   103  		"messages",
   104  		"sendTime",
   105  		"receiveTime",
   106  		"changeTime",
   107  		"byteCount",
   108  		"messageCount",
   109  		"maxBytes",
   110  		"sendPID",
   111  		"receivePID",
   112  	}
   113  }
   114  
   115  func (q *Queue) beforeSave() {}
   116  
   117  // +checklocksignore
   118  func (q *Queue) StateSave(stateSinkObject state.Sink) {
   119  	q.beforeSave()
   120  	stateSinkObject.Save(0, &q.registry)
   121  	stateSinkObject.Save(1, &q.dead)
   122  	stateSinkObject.Save(2, &q.obj)
   123  	stateSinkObject.Save(3, &q.senders)
   124  	stateSinkObject.Save(4, &q.receivers)
   125  	stateSinkObject.Save(5, &q.messages)
   126  	stateSinkObject.Save(6, &q.sendTime)
   127  	stateSinkObject.Save(7, &q.receiveTime)
   128  	stateSinkObject.Save(8, &q.changeTime)
   129  	stateSinkObject.Save(9, &q.byteCount)
   130  	stateSinkObject.Save(10, &q.messageCount)
   131  	stateSinkObject.Save(11, &q.maxBytes)
   132  	stateSinkObject.Save(12, &q.sendPID)
   133  	stateSinkObject.Save(13, &q.receivePID)
   134  }
   135  
   136  func (q *Queue) afterLoad(context.Context) {}
   137  
   138  // +checklocksignore
   139  func (q *Queue) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   140  	stateSourceObject.Load(0, &q.registry)
   141  	stateSourceObject.Load(1, &q.dead)
   142  	stateSourceObject.Load(2, &q.obj)
   143  	stateSourceObject.Load(3, &q.senders)
   144  	stateSourceObject.Load(4, &q.receivers)
   145  	stateSourceObject.Load(5, &q.messages)
   146  	stateSourceObject.Load(6, &q.sendTime)
   147  	stateSourceObject.Load(7, &q.receiveTime)
   148  	stateSourceObject.Load(8, &q.changeTime)
   149  	stateSourceObject.Load(9, &q.byteCount)
   150  	stateSourceObject.Load(10, &q.messageCount)
   151  	stateSourceObject.Load(11, &q.maxBytes)
   152  	stateSourceObject.Load(12, &q.sendPID)
   153  	stateSourceObject.Load(13, &q.receivePID)
   154  }
   155  
   156  func (m *Message) StateTypeName() string {
   157  	return "pkg/sentry/kernel/msgqueue.Message"
   158  }
   159  
   160  func (m *Message) StateFields() []string {
   161  	return []string{
   162  		"msgEntry",
   163  		"Type",
   164  		"Text",
   165  		"Size",
   166  	}
   167  }
   168  
   169  func (m *Message) beforeSave() {}
   170  
   171  // +checklocksignore
   172  func (m *Message) StateSave(stateSinkObject state.Sink) {
   173  	m.beforeSave()
   174  	stateSinkObject.Save(0, &m.msgEntry)
   175  	stateSinkObject.Save(1, &m.Type)
   176  	stateSinkObject.Save(2, &m.Text)
   177  	stateSinkObject.Save(3, &m.Size)
   178  }
   179  
   180  func (m *Message) afterLoad(context.Context) {}
   181  
   182  // +checklocksignore
   183  func (m *Message) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   184  	stateSourceObject.Load(0, &m.msgEntry)
   185  	stateSourceObject.Load(1, &m.Type)
   186  	stateSourceObject.Load(2, &m.Text)
   187  	stateSourceObject.Load(3, &m.Size)
   188  }
   189  
   190  func init() {
   191  	state.Register((*msgList)(nil))
   192  	state.Register((*msgEntry)(nil))
   193  	state.Register((*Registry)(nil))
   194  	state.Register((*Queue)(nil))
   195  	state.Register((*Message)(nil))
   196  }