aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux/modules.py
diff options
context:
space:
mode:
authorAl Stone <al.stone@linaro.org>2014-01-17 13:51:30 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-05 06:28:07 -0500
commitaf1ae78abb324def77ba0c6c3a7c7678fb5cebbe (patch)
tree93f3d9190d1c93f01e848b99b256f7a77f903e87 /scripts/gdb/linux/modules.py
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE_ONLY
ACPI hardware reduced mode exists to allow newer platforms to use a simpler form of ACPI that does not require supporting legacy versions of the specification and their associated hardware. This mode was introduced in the ACPI 5.0 specification. The ACPI hardware reduced mode is supposed to be used on systems having the HW_REDUCED_ACPI flag set in the FADT. ACPICA checks that flag to determine whether or not it should work in the HW reduced mode and there are pieces of code in it that will never be used in that case. Since some architecutres will always use the ACPI HW reduced mode, it doesn't make sense for them to ever compile support for anything else. Thus, they should set the flag ACPI_REDUCED_HARDWARE to TRUE in the ACPICA source. To enable them to do that, introduce a new kernel configuration option, CONFIG_ACPI_REDUCED_HARDWARE_ONLY, that will cause the ACPICA's ACPI_REDUCED_HARDWARE flag to be TRUE when set. Introducing this configuration item is based on suggestions from Lv Zheng saying that this does not belong in ACPICA, but rather to the Linux kernel itself. References: http://www.spinics.net/lists/linux-acpi/msg46369.html Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Al Stone <al.stone@linaro.org> [rjw: Subject and changelog] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'scripts/gdb/linux/modules.py')
0 files changed, 0 insertions, 0 deletions
span class="hl kwa">return solved; } }; CPLEXSolution::CPLEXSolution(const LinearProgram& lp, unsigned int max_num_vars, double var_lb, double var_ub) : ilo_env(), cplex_values(get_env(), max_num_vars), linprog(lp), solved(false) { get_env().setNormalizer(IloFalse); get_env().setOut(get_env().getNullStream()); if (max_num_vars > 0) solve_model(max_num_vars, var_lb, var_ub); else // Trivial case: no variables. solved = true; } void CPLEXSolution::solve_model(unsigned int max_num_vars, double var_lb, double var_ub) { try { #if DEBUG_LP_OVERHEADS >= 3 static DEFINE_CPU_CLOCK(model_costs); static DEFINE_CPU_CLOCK(solver_costs); static DEFINE_CPU_CLOCK(extract_costs); model_costs.start(); #endif IloNumVarArray cplex_vars = IloNumVarArray(get_env(), max_num_vars, var_lb, var_ub); IloObjective objective = make_objective(cplex_vars); IloRangeArray constraints = make_constraints(cplex_vars); IloModel model = IloModel(get_env()); model.add(objective); model.add(constraints); IloCplex cplex = IloCplex(model); #if DEBUG_LP_OVERHEADS >= 3 model_costs.stop(); solver_costs.start(); #endif // The primal solver seems to be slightly faster. cplex.setParam(IloCplex::RootAlg, IloCplex::Primal); cplex.setParam(IloCplex::PreDual, -1); cplex.solve(); #if DEBUG_LP_OVERHEADS >= 3 solver_costs.stop(); extract_costs.start(); #endif cplex.getValues(cplex_vars, cplex_values); solved = true; #if DEBUG_LP_OVERHEADS >= 3 extract_costs.stop(); std::cout << model_costs << std::endl << solver_costs << std::endl << extract_costs << std::endl; #endif } catch (IloException &ex) { // Improve me: we should export some kind of error info. std::cerr << "CPLEX failed: " << ex << std::endl; solved = false; } } IloObjective CPLEXSolution::make_objective(const IloNumVarArray &vars) { const LinearExpression *obj = linprog.get_objective(); IloObjective goal = IloObjective(get_env(), 0, IloObjective::Maximize); IloNumArray coeffs = IloNumArray(get_env(), vars.getSize()); assert((int) obj->get_terms().size() <= coeffs.getSize()); coeffs.add(vars.getSize(), 0); // Set coefficient for each variable in the objective function. foreach(obj->get_terms(), term) { double coefficient = term->first; unsigned int var_idx = term->second; coeffs[var_idx] = coefficient; } goal.setLinearCoefs(vars, coeffs); return goal; } IloRangeArray CPLEXSolution::make_constraints(const IloNumVarArray &vars) { IloRangeArray constraints(get_env()); foreach (linprog.get_equalities(), exp) constraints.add(make_constraint(vars, exp->first, exp->second, true)); foreach (linprog.get_inequalities(), exp) constraints.add(make_constraint(vars, exp->first, exp->second, false)); return constraints; } IloRange CPLEXSolution::make_constraint(const IloNumVarArray &vars, const LinearExpression *exp, double bound, bool is_exact_bound) { IloRange r = IloRange(get_env(), -IloInfinity, bound); if (is_exact_bound) r.setLB(bound); foreach (exp->get_terms(), term) r.setLinearCoef(vars[term->second], term->first); return r; } CPLEXSolution::~CPLEXSolution() { get_env().end(); } Solution *cplex_solve(const LinearProgram& lp, unsigned int max_num_vars) { CPLEXSolution *sol = new CPLEXSolution(lp, max_num_vars); if (sol->is_solved()) return sol; else { delete sol; return NULL; } }