Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/arch/i386 - Rename struct linux_ctx to linu...



details:   https://anonhg.NetBSD.org/src/rev/47dd7b363244
branches:  trunk
changeset: 540260:47dd7b363244
user:      junyoung <junyoung%NetBSD.org@localhost>
date:      Sun Dec 08 11:20:22 2002 +0000

description:
- Rename struct linux_ctx to linux_fpctx.
- KNF.

diffstat:

 sys/compat/linux/arch/i386/linux_ptrace.c |  82 +++++++++++++++---------------
 1 files changed, 41 insertions(+), 41 deletions(-)

diffs (144 lines):

diff -r 374bc296d5a1 -r 47dd7b363244 sys/compat/linux/arch/i386/linux_ptrace.c
--- a/sys/compat/linux/arch/i386/linux_ptrace.c Sun Dec 08 10:49:22 2002 +0000
+++ b/sys/compat/linux/arch/i386/linux_ptrace.c Sun Dec 08 11:20:22 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_ptrace.c,v 1.9 2002/12/06 10:51:27 tron Exp $    */
+/*     $NetBSD: linux_ptrace.c,v 1.10 2002/12/08 11:20:22 junyoung Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.9 2002/12/06 10:51:27 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.10 2002/12/08 11:20:22 junyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -82,41 +82,41 @@
 };
 
 /* structure used for storing floating point context */
-struct linux_ctx {
-  long cwd;
-  long swd;
-  long twd;
-  long fip;
-  long fcs;
-  long foo;
-  long fos;
-  long st_space [20];
+struct linux_fpctx {
+       long cwd;
+       long swd;
+       long twd;
+       long fip;
+       long fcs;
+       long foo;
+       long fos;
+       long st_space[20];
 };
 
 /* user struct for linux process - this is used for Linux ptrace emulation */
 /* most of it is junk only used by gdb */
 struct linux_user {
-  struct linux_reg regs;       /* registers */
-  int u_fpvalid;               /* true if math co-processor being used. */
-  struct linux_ctx i387;       /* Math Co-processor registers. */
+       struct linux_reg regs;          /* registers */
+       int u_fpvalid;          /* true if math co-processor being used. */
+       struct linux_fpctx i387;        /* Math Co-processor registers. */
 /* The rest of this junk is to help gdb figure out what goes where */
 #define lusr_startgdb  u_tsize
-  unsigned long int u_tsize;   /* Text segment size (pages). */
-  unsigned long int u_dsize;   /* Data segment size (pages). */
-  unsigned long int u_ssize;   /* Stack segment size (pages). */
-  unsigned long start_code;     /* Starting virtual address of text. */
-  unsigned long start_stack;   /* Starting virtual address of stack area.
-                                  This is actually the bottom of the stack,
-                                  the top of the stack is always found in the
-                                  esp register.  */
-  long int __signal;           /* Signal that caused the core dump. */
-  int __reserved;              /* unused */
-  void * u_ar0;                        /* Used by gdb to help find the values for */
-                               /* the registers. */
-  struct linux_ctx* u_fpstate;/* Math Co-processor pointer. */
-  unsigned long __magic;       /* To uniquely identify a core file */
-  char u_comm[32];             /* User command that was responsible */
-  int u_debugreg[8];
+       unsigned long int u_tsize;      /* Text segment size (pages). */
+       unsigned long int u_dsize;      /* Data segment size (pages). */
+       unsigned long int u_ssize;      /* Stack segment size (pages). */
+       unsigned long start_code;       /* Starting virtual address of text. */
+       unsigned long start_stack;      /* Starting virtual address of stack 
+                                          area. This is actually the bottom of
+                                          the stack, the top of the stack is
+                                          always found in the esp register. */
+       long int __signal;              /* Signal that caused the core dump. */
+       int __reserved;                 /* unused */
+       void *u_ar0;                    /* Used by gdb to help find the values
+                                          for the registers. */
+       struct linux_fpctx *u_fpstate;  /* Math Co-processor pointer. */
+       unsigned long __magic;          /* To uniquely identify a core file */
+       char u_comm[32];                /* User command that was responsible */
+       int u_debugreg[8];
 #define u_debugreg_end u_debugreg[7]
 };
 
@@ -140,7 +140,7 @@
        struct reg *regs = NULL;
        struct fpreg *fpregs = NULL;
        struct linux_reg *linux_regs = NULL;
-       struct linux_ctx *linux_fpregs = NULL;
+       struct linux_fpctx *linux_fpregs = NULL;
        int addr;
 
        request = SCARG(uap, request);
@@ -246,36 +246,36 @@
        case  LINUX_PTRACE_GETFPREGS:
                MALLOC(fpregs, struct fpreg *, sizeof(struct fpreg),
                        M_TEMP, M_WAITOK);
-               MALLOC(linux_fpregs, struct linux_ctx *,
-                       sizeof(struct linux_ctx), M_TEMP, M_WAITOK);
+               MALLOC(linux_fpregs, struct linux_fpctx *,
+                       sizeof(struct linux_fpctx), M_TEMP, M_WAITOK);
 
                error = process_read_fpregs(t, fpregs);
                if (error != 0)
                        goto out;
 
                /* zero the contents if NetBSD fpreg structure is smaller */
-               if (sizeof(struct fpreg) < sizeof(struct linux_ctx))
-                       memset(linux_fpregs, '\0', sizeof(struct linux_ctx));
+               if (sizeof(struct fpreg) < sizeof(struct linux_fpctx))
+                       memset(linux_fpregs, '\0', sizeof(struct linux_fpctx));
 
                memcpy(linux_fpregs, fpregs,
-                       min(sizeof(struct linux_ctx), sizeof(struct fpreg)));
+                       min(sizeof(struct linux_fpctx), sizeof(struct fpreg)));
                error = copyout(linux_fpregs, (caddr_t)SCARG(uap, data),
-                   sizeof(struct linux_ctx));
+                   sizeof(struct linux_fpctx));
                goto out;
 
        case  LINUX_PTRACE_SETFPREGS:
                MALLOC(fpregs, struct fpreg *, sizeof(struct fpreg),
                        M_TEMP, M_WAITOK);
-               MALLOC(linux_fpregs, struct linux_ctx *,
-                       sizeof(struct linux_ctx), M_TEMP, M_WAITOK);
+               MALLOC(linux_fpregs, struct linux_fpctx *,
+                       sizeof(struct linux_fpctx), M_TEMP, M_WAITOK);
                error = copyin((caddr_t)SCARG(uap, data), linux_fpregs,
-                   sizeof(struct linux_ctx));
+                   sizeof(struct linux_fpctx));
                if (error != 0)
                        goto out;
 
                memset(fpregs, '\0', sizeof(struct fpreg));
                memcpy(fpregs, linux_fpregs,
-                       min(sizeof(struct linux_ctx), sizeof(struct fpreg)));
+                       min(sizeof(struct linux_fpctx), sizeof(struct fpreg)));
 
                error = process_write_regs(t, regs);
                goto out;



Home | Main Index | Thread Index | Old Index