github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/kernel/msgqueue/msgqueue_state_autogen.go (about)

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