title: Field ' ' could not be resolved
body: <p>currently I am trying to compile a kernel module in userspace.
  the module is</p>
  
  <pre><code>aes_generic.c
  </code></pre>
  
  <p>so far i commented all the kernel headers and started fixing compile errors like u8 is not available 
  simpyl replaced it with uint8_t
  these errors are gone now</p>
  
  <p>I am currently struggling with the error
      field '' could not be resolved</p>
  
  <p>this error appears in various fields</p>
  
  <p>here's an example:</p>
  
  <pre><code>#define loop8(i)    do { \
  loop8tophalf(i); \
  t  = ctx-&gt;key_enc[8 * i + 4] ^ ls_box(t); \
  ctx-&gt;key_enc[8 * i + 12] = t;           \
  t ^= ctx-&gt;key_enc[8 * i + 5];           \
  ctx-&gt;key_enc[8 * i + 13] = t;           \
  t ^= ctx-&gt;key_enc[8 * i + 6];           \
  ctx-&gt;key_enc[8 * i + 14] = t;           \
  t ^= ctx-&gt;key_enc[8 * i + 7];           \
  ctx-&gt;key_enc[8 * i + 15] = t;           \
  } while (0)
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>Field 'loop8(i)' could not be resolved
  </code></pre>
  
  <p>more code with same error message:</p>
  
  <pre><code>int crypto_aes_expand_key(struct crypto_aes_ctx *ctx, const uint8_t *in_key,
      unsigned int key_len)
  {
  const __le32 *key = (const __le32 *)in_key;
  uint32_t i, t, u, v, w, j;
  
  if (key_len != AES_KEYSIZE_128 &amp;&amp; key_len != AES_KEYSIZE_192 &amp;&amp;
          key_len != AES_KEYSIZE_256)
      return -EINVAL;
  
  ctx-&gt;key_length = key_len;
  
  ctx-&gt;key_dec[key_len + 24] = ctx-&gt;key_enc[0] = le32_to_cpu(key[0]);
  ctx-&gt;key_dec[key_len + 25] = ctx-&gt;key_enc[1] = le32_to_cpu(key[1]);
  ctx-&gt;key_dec[key_len + 26] = ctx-&gt;key_enc[2] = le32_to_cpu(key[2]);
  ctx-&gt;key_dec[key_len + 27] = ctx-&gt;key_enc[3] = le32_to_cpu(key[3]);
  
  switch (key_len) {
  case AES_KEYSIZE_128:
      t = ctx-&gt;key_enc[3];
      for (i = 0; i &lt; 10; ++i)
          loop4(i);
      break;
  
  case AES_KEYSIZE_192:
      ctx-&gt;key_enc[4] = le32_to_cpu(key[4]);
      t = ctx-&gt;key_enc[5] = le32_to_cpu(key[5]);
      for (i = 0; i &lt; 8; ++i)
          loop6(i);
      break;
  
  case AES_KEYSIZE_256:
      ctx-&gt;key_enc[4] = le32_to_cpu(key[4]);
      ctx-&gt;key_enc[5] = le32_to_cpu(key[5]);
      ctx-&gt;key_enc[6] = le32_to_cpu(key[6]);
      t = ctx-&gt;key_enc[7] = le32_to_cpu(key[7]);
      for (i = 0; i &lt; 6; ++i)
          loop8(i);
      loop8tophalf(i);
      break;
  }
  
  ctx-&gt;key_dec[0] = ctx-&gt;key_enc[key_len + 24];
  ctx-&gt;key_dec[1] = ctx-&gt;key_enc[key_len + 25];
  ctx-&gt;key_dec[2] = ctx-&gt;key_enc[key_len + 26];
  ctx-&gt;key_dec[3] = ctx-&gt;key_enc[key_len + 27];
  
  for (i = 4; i &lt; key_len + 24; ++i) {
      j = key_len + 24 - (i &amp; ~3) + (i &amp; 3);
      imix_col(ctx-&gt;key_dec[j], ctx-&gt;key_enc[i]);
  }
  return 0;
  } 
  </code></pre>
  
  <p>EDIT: these errors are fixed, by manually editiong aes.h and including it in the userspace file
  thanks for help</p>