aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lufa/Projects/TempDataLogger/TempLogHostApp/DataLoggerSettings.Designer.cs
blob: 58fac514492c401ef1aa8faf57928dc794a7de12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
namespace Project1HostApp
{
    partial class frmDataloggerSettings
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnSetValues = new System.Windows.Forms.Button();
            this.dtpTime = new System.Windows.Forms.DateTimePicker();
            this.lblTime = new System.Windows.Forms.Label();
            this.lblLoggingInterval = new System.Windows.Forms.Label();
            this.nudLogInterval = new System.Windows.Forms.NumericUpDown();
            this.lblSeconds = new System.Windows.Forms.Label();
            this.btnGetValues = new System.Windows.Forms.Button();
            this.lblDate = new System.Windows.Forms.Label();
            this.dtpDate = new System.Windows.Forms.DateTimePicker();
            ((System.ComponentModel.ISupportInitialize)(this.nudLogInterval)).BeginInit();
            this.SuspendLayout();
            // 
            // btnSetValues
            // 
            this.btnSetValues.Location = new System.Drawing.Point(168, 136);
            this.btnSetValues.Name = "btnSetValues";
            this.btnSetValues.Size = new System.Drawing.Size(90, 35);
            this.btnSetValues.TabIndex = 0;
            this.btnSetValues.Text = "Set Values";
            this.btnSetValues.UseVisualStyleBackColor = true;
            this.btnSetValues.Click += new System.EventHandler(this.btnSetValues_Click);
            // 
            // dtpTime
            // 
            this.dtpTime.CustomFormat = "";
            this.dtpTime.Format = System.Windows.Forms.DateTimePickerFormat.Time;
            this.dtpTime.Location = new System.Drawing.Point(148, 61);
            this.dtpTime.Name = "dtpTime";
            this.dtpTime.ShowUpDown = true;
            this.dtpTime.Size = new System.Drawing.Size(110, 20);
            this.dtpTime.TabIndex = 1;
            // 
            // lblTime
            // 
            this.lblTime.AutoSize = true;
            this.lblTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblTime.Location = new System.Drawing.Point(51, 67);
            this.lblTime.Name = "lblTime";
            this.lblTime.Size = new System.Drawing.Size(82, 13);
            this.lblTime.TabIndex = 2;
            this.lblTime.Text = "Device Time:";
            // 
            // lblLoggingInterval
            // 
            this.lblLoggingInterval.AutoSize = true;
            this.lblLoggingInterval.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblLoggingInterval.Location = new System.Drawing.Point(30, 101);
            this.lblLoggingInterval.Name = "lblLoggingInterval";
            this.lblLoggingInterval.Size = new System.Drawing.Size(103, 13);
            this.lblLoggingInterval.TabIndex = 3;
            this.lblLoggingInterval.Text = "Logging Interval:";
            // 
            // nudLogInterval
            // 
            this.nudLogInterval.Location = new System.Drawing.Point(148, 94);
            this.nudLogInterval.Maximum = new decimal(new int[] {
            60,
            0,
            0,
            0});
            this.nudLogInterval.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.nudLogInterval.Name = "nudLogInterval";
            this.nudLogInterval.Size = new System.Drawing.Size(51, 20);
            this.nudLogInterval.TabIndex = 5;
            this.nudLogInterval.Value = new decimal(new int[] {
            5,
            0,
            0,
            0});
            // 
            // lblSeconds
            // 
            this.lblSeconds.AutoSize = true;
            this.lblSeconds.Location = new System.Drawing.Point(209, 101);
            this.lblSeconds.Name = "lblSeconds";
            this.lblSeconds.Size = new System.Drawing.Size(49, 13);
            this.lblSeconds.TabIndex = 6;
            this.lblSeconds.Text = "Seconds";
            // 
            // btnGetValues
            // 
            this.btnGetValues.Location = new System.Drawing.Point(30, 136);
            this.btnGetValues.Name = "btnGetValues";
            this.btnGetValues.Size = new System.Drawing.Size(90, 35);
            this.btnGetValues.TabIndex = 7;
            this.btnGetValues.Text = "Get Values";
            this.btnGetValues.UseVisualStyleBackColor = true;
            this.btnGetValues.Click += new System.EventHandler(this.btnGetValues_Click);
            // 
            // lblDate
            // 
            this.lblDate.AutoSize = true;
            this.lblDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblDate.Location = new System.Drawing.Point(51, 33);
            this.lblDate.Name = "lblDate";
            this.lblDate.Size = new System.Drawing.Size(82, 13);
            this.lblDate.TabIndex = 8;
            this.lblDate.Text = "Device Date:";
            // 
            // dtpDate
            // 
            this.dtpDate.CustomFormat = "dd/MM/yyyy";
            this.dtpDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
            this.dtpDate.Location = new System.Drawing.Point(148, 27);
            this.dtpDate.Name = "dtpDate";
            this.dtpDate.Size = new System.Drawing.Size(110, 20);
            this.dtpDate.TabIndex = 9;
            // 
            // frmDataloggerSettings
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(300, 197);
            this.Controls.Add(this.dtpDate);
            this.Controls.Add(this.lblDate);
            this.Controls.Add(this.btnGetValues);
            this.Controls.Add(this.lblSeconds);
            this.Controls.Add(this.nudLogInterval);
            this.Controls.Add(this.lblLoggingInterval);
            this.Controls.Add(this.lblTime);
            this.Controls.Add(this.dtpTime);
            this.Controls.Add(this.btnSetValues);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "frmDataloggerSettings";
            this.Text = "Datalogger";
            this.Load += new System.EventHandler(this.frmDataloggerSettings_Load);
            ((System.ComponentModel.ISupportInitialize)(this.nudLogInterval)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btnSetValues;
        private System.Windows.Forms.DateTimePicker dtpTime;
        private System.Windows.Forms.Label lblTime;
        private System.Windows.Forms.Label lblLoggingInterval;
        private System.Windows.Forms.NumericUpDown nudLogInterval;
        private System.Windows.Forms.Label lblSeconds;
        private System.Windows.Forms.Button btnGetValues;
        private System.Windows.Forms.Label lblDate;
        private System.Windows.Forms.DateTimePicker dtpDate;
    }
}
ared_info); free_all_dom_mem(p); free_task_struct(p); #else printk("XEN::release_task: not freeing memory etc yet XXX FIXME.\n"); #endif } /* final_setup_guestos is used for final setup and launching of domains other * than domain 0. ie. the domains that are being built by the userspace dom0 * domain builder. * * Initial load map: * start_address: * OS image * .... * stack_start: * start_info: * <one page> * page tables: * <enough pages> * end_address: * shared_info: * <one page> */ int final_setup_guestos(struct task_struct * p, dom_meminfo_t * meminfo) { l2_pgentry_t * l2tab; l1_pgentry_t * l1tab; start_info_t * virt_startinfo_addr; unsigned long virt_stack_addr; unsigned long phys_l2tab; net_ring_t *net_ring; net_vif_t *net_vif; /* entries 0xe0000000 onwards in page table must contain hypervisor * mem mappings - set them up. */ phys_l2tab = meminfo->l2_pgt_addr; l2tab = map_domain_mem(phys_l2tab); memcpy(l2tab + DOMAIN_ENTRIES_PER_L2_PAGETABLE, ((l2_pgentry_t *)idle_pg_table[p->processor]) + DOMAIN_ENTRIES_PER_L2_PAGETABLE, (ENTRIES_PER_L2_PAGETABLE - DOMAIN_ENTRIES_PER_L2_PAGETABLE) * sizeof(l2_pgentry_t)); l2tab[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT] = mk_l2_pgentry(__pa(p->mm.perdomain_pt) | PAGE_HYPERVISOR); p->mm.pagetable = mk_pagetable(phys_l2tab); unmap_domain_mem(l2tab); /* map in the shared info structure */ phys_l2tab = pagetable_val(p->mm.pagetable); l2tab = map_domain_mem(phys_l2tab); l2tab += l2_table_offset(meminfo->virt_shinfo_addr); l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab)); l1tab += l1_table_offset(meminfo->virt_shinfo_addr); *l1tab = mk_l1_pgentry(__pa(p->shared_info) | L1_PROT); unmap_domain_mem((void *)((unsigned long)l2tab & PAGE_MASK)); unmap_domain_mem((void *)((unsigned long)l1tab & PAGE_MASK)); /* set up the shared info structure */ update_dom_time(p->shared_info); p->shared_info->cpu_freq = cpu_freq; p->shared_info->domain_time = 0; /* we pass start info struct to guest os as function parameter on stack */ virt_startinfo_addr = (start_info_t *)meminfo->virt_startinfo_addr; virt_stack_addr = (unsigned long)virt_startinfo_addr; /* we need to populate start_info struct within the context of the * new domain. thus, temporarely install its pagetables. */ __cli(); __asm__ __volatile__ ( "mov %%eax,%%cr3" : : "a" (pagetable_val(p->mm.pagetable))); memset(virt_startinfo_addr, 0, sizeof(*virt_startinfo_addr)); virt_startinfo_addr->nr_pages = p->tot_pages; virt_startinfo_addr->shared_info = (shared_info_t *)meminfo->virt_shinfo_addr; virt_startinfo_addr->pt_base = meminfo->virt_load_addr + ((p->tot_pages - 1) << PAGE_SHIFT); /* Add virtual network interfaces and point to them in startinfo. */ while (meminfo->num_vifs-- > 0) { net_vif = create_net_vif(p->domain); net_ring = net_vif->net_ring; if (!net_ring) panic("no network ring!\n"); } /* XXX SMH: horrible hack to convert hypervisor VAs in SHIP to guest VAs */ #define SH2G(_x) (meminfo->virt_shinfo_addr | (((unsigned long)(_x)) & 0xFFF)) virt_startinfo_addr->net_rings = (net_ring_t *)SH2G(p->net_ring_base); virt_startinfo_addr->num_net_rings = p->num_net_vifs; /* Add block io interface */ virt_startinfo_addr->blk_ring = virt_to_phys(p->blk_ring_base); /* Copy the command line */ strcpy(virt_startinfo_addr->cmd_line, meminfo->cmd_line); /* Reinstate the caller's page tables. */ __asm__ __volatile__ ( "mov %%eax,%%cr3" : : "a" (pagetable_val(current->mm.pagetable))); __sti(); new_thread(p, (unsigned long)meminfo->virt_load_addr, (unsigned long)virt_stack_addr, (unsigned long)virt_startinfo_addr); return 0; } static unsigned long alloc_page_from_domain(unsigned long * cur_addr, unsigned long * index) { unsigned long ret = *cur_addr; struct list_head *ent = frame_table[ret >> PAGE_SHIFT].list.prev; *cur_addr = list_entry(ent, struct pfn_info, list) - frame_table; *cur_addr <<= PAGE_SHIFT; (*index)--; return ret; } /* setup_guestos is used for building dom0 solely. other domains are built in * userspace dom0 and final setup is being done by final_setup_guestos. */ int setup_guestos(struct task_struct *p, dom0_newdomain_t *params) { struct list_head *list_ent; char *src, *dst; int i, dom = p->domain; unsigned long phys_l1tab, phys_l2tab; unsigned long cur_address, alloc_address; unsigned long virt_load_address, virt_stack_address, virt_shinfo_address; start_info_t *virt_startinfo_address; unsigned long count; unsigned long alloc_index; l2_pgentry_t *l2tab, *l2start; l1_pgentry_t *l1tab = NULL, *l1start = NULL; struct pfn_info *page = NULL; net_ring_t *net_ring; net_vif_t *net_vif; /* Sanity! */ if ( p->domain != 0 ) BUG(); if ( strncmp(__va(mod[0].mod_start), "XenoGues", 8) ) { printk("DOM%d: Invalid guest OS image\n", dom); return -1; } virt_load_address = *(unsigned long *)__va(mod[0].mod_start + 8); if ( (virt_load_address & (PAGE_SIZE-1)) ) { printk("DOM%d: Guest OS load address not page-aligned (%08lx)\n", dom, virt_load_address); return -1; } if ( alloc_new_dom_mem(p, params->memory_kb) ) return -ENOMEM; alloc_address = list_entry(p->pg_head.prev, struct pfn_info, list) - frame_table; alloc_address <<= PAGE_SHIFT; alloc_index = p->tot_pages; if ( (mod[nr_mods-1].mod_end-mod[0].mod_start) > (params->memory_kb << 9) ) { printk("DOM%d: Guest OS image is too large\n" " (%luMB is greater than %uMB limit for a\n" " %uMB address space)\n", dom, (mod[nr_mods-1].mod_end-mod[0].mod_start)>>20, (params->memory_kb)>>11, (params->memory_kb)>>10); free_all_dom_mem(p); return -1; } printk("DOM%d: Guest OS virtual load address is %08lx\n", dom, virt_load_address); /* * WARNING: The new domain must have its 'processor' field * filled in by now !! */ phys_l2tab = alloc_page_from_domain(&alloc_address, &alloc_index); l2start = l2tab = map_domain_mem(phys_l2tab); memcpy(l2tab, idle_pg_table[p->processor], PAGE_SIZE); l2tab[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT] = mk_l2_pgentry(__pa(p->mm.perdomain_pt) | __PAGE_HYPERVISOR); memset(l2tab, 0, DOMAIN_ENTRIES_PER_L2_PAGETABLE*sizeof(l2_pgentry_t)); p->mm.pagetable = mk_pagetable(phys_l2tab); /* * NB. The upper limit on this loop does one extra page. This is to make * sure a pte exists when we want to map the shared_info struct. */ l2tab += l2_table_offset(virt_load_address); cur_address = list_entry(p->pg_head.next, struct pfn_info, list) - frame_table; cur_address <<= PAGE_SHIFT; for ( count = 0; count < p->tot_pages + 1; count++ ) { if ( !((unsigned long)l1tab & (PAGE_SIZE-1)) ) { if ( l1tab != NULL ) unmap_domain_mem(l1start); phys_l1tab = alloc_page_from_domain(&alloc_address, &alloc_index); *l2tab++ = mk_l2_pgentry(phys_l1tab|L2_PROT); l1start = l1tab = map_domain_mem(phys_l1tab); clear_page(l1tab); l1tab += l1_table_offset( virt_load_address + (count << PAGE_SHIFT)); } *l1tab++ = mk_l1_pgentry(cur_address|L1_PROT); if ( count < p->tot_pages ) { page = frame_table + (cur_address >> PAGE_SHIFT); page->flags = dom | PGT_writeable_page; page->type_count = page->tot_count = 1; /* Set up the MPT entry. */ machine_to_phys_mapping[cur_address >> PAGE_SHIFT] = count; } list_ent = frame_table[cur_address >> PAGE_SHIFT].list.next; cur_address = list_entry(list_ent, struct pfn_info, list) - frame_table; cur_address <<= PAGE_SHIFT; } unmap_domain_mem(l1start); /* pages that are part of page tables must be read only */ cur_address = list_entry(p->pg_head.next, struct pfn_info, list) - frame_table; cur_address <<= PAGE_SHIFT; for ( count = 0; count < alloc_index; count++ ) { list_ent = frame_table[cur_address >> PAGE_SHIFT].list.next; cur_address = list_entry(list_ent, struct pfn_info, list) - frame_table; cur_address <<= PAGE_SHIFT; } l2tab = l2start + l2_table_offset(virt_load_address + (alloc_index << PAGE_SHIFT)); l1start = l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab)); l1tab += l1_table_offset(virt_load_address + (alloc_index << PAGE_SHIFT)); l2tab++; for ( count = alloc_index; count < p->tot_pages; count++ ) { *l1tab++ = mk_l1_pgentry(l1_pgentry_val(*l1tab) & ~_PAGE_RW); if( !((unsigned long)l1tab & (PAGE_SIZE - 1)) ) { unmap_domain_mem(l1start); l1start = l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab)); l2tab++; } page = frame_table + (cur_address >> PAGE_SHIFT); page->flags = dom | PGT_l1_page_table; page->tot_count++; list_ent = frame_table[cur_address >> PAGE_SHIFT].list.next; cur_address = list_entry(list_ent, struct pfn_info, list) - frame_table; cur_address <<= PAGE_SHIFT; } page->type_count |= REFCNT_PIN_BIT; page->tot_count |= REFCNT_PIN_BIT; page->flags = dom | PGT_l2_page_table; unmap_domain_mem(l1start); /* Map in the the shared info structure. */ virt_shinfo_address = virt_load_address + (p->tot_pages << PAGE_SHIFT); l2tab = l2start + l2_table_offset(virt_shinfo_address); l1start = l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab)); l1tab += l1_table_offset(virt_shinfo_address); *l1tab = mk_l1_pgentry(__pa(p->shared_info)|L1_PROT); unmap_domain_mem(l1start); /* Set up shared info area. */ update_dom_time(p->shared_info); p->shared_info->cpu_freq = cpu_freq; p->shared_info->domain_time = 0; virt_startinfo_address = (start_info_t *) (virt_load_address + ((alloc_index - 1) << PAGE_SHIFT)); virt_stack_address = (unsigned long)virt_startinfo_address; unmap_domain_mem(l2start); /* Install the new page tables. */ __cli(); __write_cr3_counted(pagetable_val(p->mm.pagetable)); /* Copy the guest OS image. */ src = (char *)__va(mod[0].mod_start + 12); dst = (char *)virt_load_address; while ( src < (char *)__va(mod[nr_mods-1].mod_end) ) *dst++ = *src++; /* Set up start info area. */ memset(virt_startinfo_address, 0, sizeof(*virt_startinfo_address)); virt_startinfo_address->nr_pages = p->tot_pages; virt_startinfo_address->shared_info = (shared_info_t *)virt_shinfo_address; virt_startinfo_address->pt_base = virt_load_address + ((p->tot_pages - 1) << PAGE_SHIFT); /* Add virtual network interfaces and point to them in startinfo. */ while (params->num_vifs-- > 0) { net_vif = create_net_vif(dom); net_ring = net_vif->net_ring; if (!net_ring) panic("no network ring!\n"); } /* XXX SMH: horrible hack to convert hypervisor VAs in SHIP to guest VAs */ #define SHIP2GUEST(_x) (virt_shinfo_address | (((unsigned long)(_x)) & 0xFFF)) virt_startinfo_address->net_rings = (net_ring_t *)SHIP2GUEST(p->net_ring_base); virt_startinfo_address->num_net_rings = p->num_net_vifs; /* Add block io interface */ virt_startinfo_address->blk_ring = virt_to_phys(p->blk_ring_base); /* We tell OS about any modules we were given. */ if ( nr_mods > 1 ) { virt_startinfo_address->mod_start = (mod[1].mod_start-mod[0].mod_start-12) + virt_load_address; virt_startinfo_address->mod_len = mod[nr_mods-1].mod_end - mod[1].mod_start; } dst = virt_startinfo_address->cmd_line; if ( mod[0].string ) { char *modline = (char *)__va(mod[0].string); for ( i = 0; i < 255; i++ ) { if ( modline[i] == '\0' ) break; *dst++ = modline[i]; } } *dst = '\0'; /* Reinstate the caller's page tables. */ __write_cr3_counted(pagetable_val(current->mm.pagetable)); __sti(); new_thread(p, (unsigned long)virt_load_address, (unsigned long)virt_stack_address, (unsigned long)virt_startinfo_address); return 0; } void __init domain_init(void) { printk("Initialising domains\n"); }